Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
58f491ae
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
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看板
提交
58f491ae
编写于
3月 21, 2012
作者:
D
dcherepanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7150349: [macosx] Applets attempting to show popup menus activate the applet process
Reviewed-by: ant
上级
da85f117
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
54 addition
and
20 deletion
+54
-20
src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
+20
-11
src/macosx/classes/sun/lwawt/macosx/CWrapper.java
src/macosx/classes/sun/lwawt/macosx/CWrapper.java
+1
-0
src/macosx/native/sun/awt/AWTWindow.m
src/macosx/native/sun/awt/AWTWindow.m
+6
-5
src/macosx/native/sun/awt/CWrapper.m
src/macosx/native/sun/awt/CWrapper.m
+20
-0
src/macosx/native/sun/awt/LWCToolkit.m
src/macosx/native/sun/awt/LWCToolkit.m
+7
-4
未找到文件。
src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
浏览文件 @
58f491ae
...
...
@@ -113,6 +113,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
static
final
int
MINIMIZABLE
=
1
<<
8
;
static
final
int
RESIZABLE
=
1
<<
9
;
// both a style bit and prop bit
static
final
int
NONACTIVATING
=
1
<<
24
;
static
final
int
_STYLE_PROP_BITMASK
=
DECORATED
|
TEXTURED
|
UNIFIED
|
UTILITY
|
HUD
|
SHEET
|
CLOSEABLE
|
MINIMIZABLE
|
RESIZABLE
;
...
...
@@ -128,9 +129,6 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
static
final
int
_METHOD_PROP_BITMASK
=
RESIZABLE
|
HAS_SHADOW
|
ZOOMABLE
|
ALWAYS_ON_TOP
|
HIDES_ON_DEACTIVATE
|
DRAGGABLE_BACKGROUND
|
DOCUMENT_MODIFIED
|
FULLSCREENABLE
;
// not sure
static
final
int
POPUP
=
1
<<
14
;
// corresponds to callback-based properties
static
final
int
SHOULD_BECOME_KEY
=
1
<<
12
;
static
final
int
SHOULD_BECOME_MAIN
=
1
<<
13
;
...
...
@@ -265,10 +263,6 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
// defaults style bits
int
styleBits
=
DECORATED
|
HAS_SHADOW
|
CLOSEABLE
|
MINIMIZABLE
|
ZOOMABLE
|
RESIZABLE
;
if
(
target
.
getName
()
==
"###overrideRedirect###"
)
{
styleBits
=
SET
(
styleBits
,
POPUP
,
true
);
}
if
(
isNativelyFocusableWindow
())
{
styleBits
=
SET
(
styleBits
,
SHOULD_BECOME_KEY
,
true
);
styleBits
=
SET
(
styleBits
,
SHOULD_BECOME_MAIN
,
true
);
...
...
@@ -276,6 +270,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
final
boolean
isFrame
=
(
target
instanceof
Frame
);
final
boolean
isDialog
=
(
target
instanceof
Dialog
);
final
boolean
isPopup
=
(
target
.
getType
()
==
Window
.
Type
.
POPUP
);
if
(
isDialog
)
{
styleBits
=
SET
(
styleBits
,
MINIMIZABLE
,
false
);
}
...
...
@@ -305,8 +300,10 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
}
// If the target is a dialog, popup or tooltip we want it to ignore the brushed metal look.
if
(
!
isDialog
&&
IS
(
styleBits
,
POPUP
)
)
{
if
(
isPopup
)
{
styleBits
=
SET
(
styleBits
,
TEXTURED
,
true
);
// Popups in applets don't activate applet's process
styleBits
=
SET
(
styleBits
,
NONACTIVATING
,
true
);
}
if
(
target
instanceof
javax
.
swing
.
RootPaneContainer
)
{
...
...
@@ -499,12 +496,19 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
// If it ain't blocked, or is being hidden, go regular way
if
(
visible
)
{
CWrapper
.
NSWindow
.
makeFirstResponder
(
nsWindowPtr
,
contentView
.
getAWTView
());
boolean
isKeyWindow
=
CWrapper
.
NSWindow
.
isKeyWindow
(
nsWindowPtr
);
if
(!
isKeyWindow
)
{
CWrapper
.
NSWindow
.
makeKeyAndOrderFront
(
nsWindowPtr
);
boolean
isPopup
=
(
target
.
getType
()
==
Window
.
Type
.
POPUP
);
if
(
isPopup
)
{
// Popups in applets don't activate applet's process
CWrapper
.
NSWindow
.
orderFrontRegardless
(
nsWindowPtr
);
}
else
{
CWrapper
.
NSWindow
.
orderFront
(
nsWindowPtr
);
}
boolean
isKeyWindow
=
CWrapper
.
NSWindow
.
isKeyWindow
(
nsWindowPtr
);
if
(!
isKeyWindow
)
{
CWrapper
.
NSWindow
.
makeKeyWindow
(
nsWindowPtr
);
}
}
else
{
CWrapper
.
NSWindow
.
orderOut
(
nsWindowPtr
);
}
...
...
@@ -765,6 +769,11 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
* Callbacks from the AWTWindow and AWTView objc classes.
*************************************************************/
private
void
deliverWindowFocusEvent
(
boolean
gained
){
// Fix for 7150349: ingore "gained" notifications when the app is inactive.
if
(
gained
&&
!((
LWCToolkit
)
Toolkit
.
getDefaultToolkit
()).
isApplicationActive
())
{
focusLogger
.
fine
(
"the app is inactive, so the notification is ignored"
);
return
;
}
peer
.
notifyActivation
(
gained
);
}
...
...
src/macosx/classes/sun/lwawt/macosx/CWrapper.java
浏览文件 @
58f491ae
...
...
@@ -47,6 +47,7 @@ public final class CWrapper {
public
static
native
void
setLevel
(
long
window
,
int
level
);
public
static
native
void
makeKeyAndOrderFront
(
long
window
);
public
static
native
void
makeKeyWindow
(
long
window
);
public
static
native
void
makeMainWindow
(
long
window
);
public
static
native
boolean
canBecomeMainWindow
(
long
window
);
public
static
native
boolean
isKeyWindow
(
long
window
);
...
...
src/macosx/native/sun/awt/AWTWindow.m
浏览文件 @
58f491ae
...
...
@@ -102,11 +102,12 @@ static JNF_CLASS_CACHE(jc_CPlatformWindow, "sun/lwawt/macosx/CPlatformWindow");
type
|=
NSBorderlessWindowMask
;
}
if
(
IS
(
styleBits
,
TEXTURED
))
type
|=
NSTexturedBackgroundWindowMask
;
if
(
IS
(
styleBits
,
UNIFIED
))
type
|=
NSUnifiedTitleAndToolbarWindowMask
;
if
(
IS
(
styleBits
,
UTILITY
))
type
|=
NSUtilityWindowMask
;
if
(
IS
(
styleBits
,
HUD
))
type
|=
NSHUDWindowMask
;
if
(
IS
(
styleBits
,
SHEET
))
type
|=
NSDocModalWindowMask
;
if
(
IS
(
styleBits
,
TEXTURED
))
type
|=
NSTexturedBackgroundWindowMask
;
if
(
IS
(
styleBits
,
UNIFIED
))
type
|=
NSUnifiedTitleAndToolbarWindowMask
;
if
(
IS
(
styleBits
,
UTILITY
))
type
|=
NSUtilityWindowMask
;
if
(
IS
(
styleBits
,
HUD
))
type
|=
NSHUDWindowMask
;
if
(
IS
(
styleBits
,
SHEET
))
type
|=
NSDocModalWindowMask
;
if
(
IS
(
styleBits
,
NONACTIVATING
))
type
|=
NSNonactivatingPanelMask
;
return
type
;
}
...
...
src/macosx/native/sun/awt/CWrapper.m
浏览文件 @
58f491ae
...
...
@@ -74,6 +74,26 @@ JNF_COCOA_ENTER(env);
JNF_COCOA_EXIT
(
env
);
}
/*
* Class: sun_lwawt_macosx_CWrapper$NSWindow
* Method: makeKeyWindow
* Signature: (J)V
*/
JNIEXPORT
void
JNICALL
Java_sun_lwawt_macosx_CWrapper_00024NSWindow_makeKeyWindow
(
JNIEnv
*
env
,
jclass
cls
,
jlong
windowPtr
)
{
JNF_COCOA_ENTER
(
env
);
NSWindow
*
window
=
(
NSWindow
*
)
jlong_to_ptr
(
windowPtr
);
[
JNFRunLoop
performOnMainThread
:
@selector
(
makeKeyWindow
)
on:
window
withObject:
nil
waitUntilDone:
NO
];
JNF_COCOA_EXIT
(
env
);
}
/*
* Class: sun_lwawt_macosx_CWrapper$NSWindow
* Method: makeMainWindow
...
...
src/macosx/native/sun/awt/LWCToolkit.m
浏览文件 @
58f491ae
...
...
@@ -401,18 +401,21 @@ JNIEXPORT jboolean JNICALL Java_sun_lwawt_macosx_LWCToolkit_isCapsLockOn
JNIEXPORT
jboolean
JNICALL
Java_sun_lwawt_macosx_LWCToolkit_isApplicationActive
(
JNIEnv
*
env
,
jclass
clazz
)
{
__block
jboolean
active
=
JNI_FALSE
;
__block
jboolean
active
=
JNI_FALSE
;
AWT_ASSERT_NOT_APPKIT_THREAD
;
JNF_COCOA_ENTER
(
env
);
if
([
NSThread
isMainThread
])
{
active
=
(
jboolean
)[
NSRunningApplication
currentApplication
].
active
;
}
else
{
[
JNFRunLoop
performOnMainThreadWaiting
:
YES
withBlock
:
^
()
{
active
=
(
jboolean
)[
NSRunningApplication
currentApplication
].
active
;
active
=
(
jboolean
)[
NSRunningApplication
currentApplication
].
active
;
}];
}
JNF_COCOA_EXIT
(
env
);
return
active
;
return
active
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录