Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
e27fb691
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
3
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e27fb691
编写于
4月 25, 2012
作者:
L
leonidr
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7154480: [macosx] Not all popup menu items are visible
Reviewed-by: art
上级
b3608893
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
42 addition
and
15 deletion
+42
-15
src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
+9
-1
src/share/classes/javax/swing/JPopupMenu.java
src/share/classes/javax/swing/JPopupMenu.java
+10
-13
src/share/classes/sun/awt/SunToolkit.java
src/share/classes/sun/awt/SunToolkit.java
+23
-1
未找到文件。
src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
浏览文件 @
e27fb691
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011,
2012,
Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -656,6 +656,14 @@ public class LWCToolkit extends LWToolkit {
return
((
mods
&
(
InputEvent
.
META_MASK
|
InputEvent
.
CTRL_MASK
))
==
0
);
}
/**
* Returns whether popup is allowed to be shown above the task bar.
*/
@Override
public
boolean
canPopupOverlapTaskBar
()
{
return
false
;
}
// Extends PeerEvent because we want to pass long an ObjC mediator object and because we want these events to be posted early
// Typically, rather than relying on the notifier to call notifyAll(), we use the mediator to stop the runloop
public
static
class
CPeerEvent
extends
PeerEvent
{
...
...
src/share/classes/javax/swing/JPopupMenu.java
浏览文件 @
e27fb691
/*
* Copyright (c) 1997, 20
08
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 20
12
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -41,6 +41,8 @@ import javax.swing.plaf.PopupMenuUI;
import
javax.swing.plaf.ComponentUI
;
import
javax.swing.plaf.basic.BasicComboPopup
;
import
javax.swing.event.*
;
import
sun.awt.SunToolkit
;
import
sun.security.util.SecurityConstants
;
import
java.applet.Applet
;
...
...
@@ -347,6 +349,7 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement {
long
popupBottomY
=
(
long
)
popupLocation
.
y
+
(
long
)
popupSize
.
height
;
int
scrWidth
=
scrBounds
.
width
;
int
scrHeight
=
scrBounds
.
height
;
if
(!
canPopupOverlapTaskBar
())
{
// Insets include the task bar. Take them into account.
Insets
scrInsets
=
toolkit
.
getScreenInsets
(
gc
);
...
...
@@ -407,25 +410,19 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement {
}
/**
* Checks that there are enough security permissions
* to make popup "always on top", which allows to show it above the task bar.
* Returns whether popup is allowed to be shown above the task bar.
*/
static
boolean
canPopupOverlapTaskBar
()
{
boolean
result
=
true
;
try
{
SecurityManager
sm
=
System
.
getSecurityManager
();
if
(
sm
!=
null
)
{
sm
.
checkPermission
(
SecurityConstants
.
AWT
.
SET_WINDOW_ALWAYS_ON_TOP_PERMISSION
);
}
}
catch
(
SecurityException
se
)
{
// There is no permission to show popups over the task bar
result
=
false
;
Toolkit
tk
=
Toolkit
.
getDefaultToolkit
();
if
(
tk
instanceof
SunToolkit
)
{
result
=
((
SunToolkit
)
tk
).
canPopupOverlapTaskBar
();
}
return
result
;
}
/**
* Factory method which creates the <code>JMenuItem</code> for
* <code>Actions</code> added to the <code>JPopupMenu</code>.
...
...
src/share/classes/sun/awt/SunToolkit.java
浏览文件 @
e27fb691
/*
* Copyright (c) 1997, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
2
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -42,6 +42,8 @@ import java.util.concurrent.TimeUnit;
import
java.util.concurrent.locks.Condition
;
import
java.util.concurrent.locks.Lock
;
import
java.util.concurrent.locks.ReentrantLock
;
import
sun.security.util.SecurityConstants
;
import
sun.util.logging.PlatformLogger
;
import
sun.misc.SoftCache
;
import
sun.font.FontDesignMetrics
;
...
...
@@ -1135,6 +1137,26 @@ public abstract class SunToolkit extends Toolkit
return
((
mods
&
InputEvent
.
ALT_MASK
)
==
(
mods
&
InputEvent
.
CTRL_MASK
));
}
/**
* Returns whether popup is allowed to be shown above the task bar.
* This is a default implementation of this method, which checks
* corresponding security permission.
*/
public
boolean
canPopupOverlapTaskBar
()
{
boolean
result
=
true
;
try
{
SecurityManager
sm
=
System
.
getSecurityManager
();
if
(
sm
!=
null
)
{
sm
.
checkPermission
(
SecurityConstants
.
AWT
.
SET_WINDOW_ALWAYS_ON_TOP_PERMISSION
);
}
}
catch
(
SecurityException
se
)
{
// There is no permission to show popups over the task bar
result
=
false
;
}
return
result
;
}
/**
* Returns a new input method window, with behavior as specified in
* {@link java.awt.im.spi.InputMethodContext#createInputMethodWindow}.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录