Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
8f9460fa
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看板
提交
8f9460fa
编写于
5月 03, 2012
作者:
L
leonidr
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7124376: [macosx] Modal dialog lost focus
Reviewed-by: anthony
上级
4120c120
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
94 addition
and
30 deletion
+94
-30
src/macosx/classes/sun/lwawt/LWWindowPeer.java
src/macosx/classes/sun/lwawt/LWWindowPeer.java
+2
-0
src/macosx/classes/sun/lwawt/PlatformWindow.java
src/macosx/classes/sun/lwawt/PlatformWindow.java
+2
-0
src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java
...cosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java
+3
-0
src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
+10
-0
src/macosx/native/sun/awt/AWTView.m
src/macosx/native/sun/awt/AWTView.m
+14
-5
src/macosx/native/sun/awt/AWTWindow.h
src/macosx/native/sun/awt/AWTWindow.h
+2
-0
src/macosx/native/sun/awt/AWTWindow.m
src/macosx/native/sun/awt/AWTWindow.m
+61
-25
未找到文件。
src/macosx/classes/sun/lwawt/LWWindowPeer.java
浏览文件 @
8f9460fa
...
@@ -409,6 +409,8 @@ public class LWWindowPeer
...
@@ -409,6 +409,8 @@ public class LWWindowPeer
synchronized
(
getPeerTreeLock
())
{
synchronized
(
getPeerTreeLock
())
{
this
.
blocker
=
blocked
?
(
LWWindowPeer
)
blocker
.
getPeer
()
:
null
;
this
.
blocker
=
blocked
?
(
LWWindowPeer
)
blocker
.
getPeer
()
:
null
;
}
}
platformWindow
.
setModalBlocked
(
blocked
);
}
}
@Override
@Override
...
...
src/macosx/classes/sun/lwawt/PlatformWindow.java
浏览文件 @
8f9460fa
...
@@ -108,6 +108,8 @@ public interface PlatformWindow {
...
@@ -108,6 +108,8 @@ public interface PlatformWindow {
public
void
flip
(
int
x1
,
int
y1
,
int
x2
,
int
y2
,
public
void
flip
(
int
x1
,
int
y1
,
int
x2
,
int
y2
,
BufferCapabilities
.
FlipContents
flipAction
);
BufferCapabilities
.
FlipContents
flipAction
);
public
void
setModalBlocked
(
boolean
blocked
);
public
void
toFront
();
public
void
toFront
();
public
void
toBack
();
public
void
toBack
();
...
...
src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java
浏览文件 @
8f9460fa
...
@@ -205,4 +205,7 @@ public class CPlatformEmbeddedFrame implements PlatformWindow {
...
@@ -205,4 +205,7 @@ public class CPlatformEmbeddedFrame implements PlatformWindow {
@Override
@Override
public
void
setWindowState
(
int
windowState
)
{}
public
void
setWindowState
(
int
windowState
)
{}
@Override
public
void
setModalBlocked
(
boolean
blocked
)
{}
}
}
src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
浏览文件 @
8f9460fa
...
@@ -61,6 +61,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
...
@@ -61,6 +61,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
private
static
native
void
nativeSetNSWindowMinimizedIcon
(
long
nsWindowPtr
,
long
nsImage
);
private
static
native
void
nativeSetNSWindowMinimizedIcon
(
long
nsWindowPtr
,
long
nsImage
);
private
static
native
void
nativeSetNSWindowRepresentedFilename
(
long
nsWindowPtr
,
String
representedFilename
);
private
static
native
void
nativeSetNSWindowRepresentedFilename
(
long
nsWindowPtr
,
String
representedFilename
);
private
static
native
void
nativeSetNSWindowSecurityWarningPositioning
(
long
nsWindowPtr
,
double
x
,
double
y
,
float
biasX
,
float
biasY
);
private
static
native
void
nativeSetNSWindowSecurityWarningPositioning
(
long
nsWindowPtr
,
double
x
,
double
y
,
float
biasX
,
float
biasY
);
private
static
native
void
nativeSetEnabled
(
long
nsWindowPtr
,
boolean
isEnabled
);
private
static
native
void
nativeSynthesizeMouseEnteredExitedEvents
(
long
nsWindowPtr
);
private
static
native
void
nativeSynthesizeMouseEnteredExitedEvents
(
long
nsWindowPtr
);
private
static
native
int
nativeGetScreenNSWindowIsOn_AppKitThread
(
long
nsWindowPtr
);
private
static
native
int
nativeGetScreenNSWindowIsOn_AppKitThread
(
long
nsWindowPtr
);
...
@@ -800,6 +801,15 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
...
@@ -800,6 +801,15 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
// value when the native notification comes to us
// value when the native notification comes to us
}
}
@Override
public
void
setModalBlocked
(
boolean
blocked
)
{
if
(
target
.
getModalExclusionType
()
==
Dialog
.
ModalExclusionType
.
APPLICATION_EXCLUDE
)
{
return
;
}
nativeSetEnabled
(
getNSWindowPtr
(),
!
blocked
);
}
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------
// UTILITY METHODS
// UTILITY METHODS
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------
...
...
src/macosx/native/sun/awt/AWTView.m
浏览文件 @
8f9460fa
...
@@ -302,6 +302,15 @@ AWT_ASSERT_APPKIT_THREAD;
...
@@ -302,6 +302,15 @@ AWT_ASSERT_APPKIT_THREAD;
*/
*/
-
(
void
)
deliverJavaMouseEvent
:
(
NSEvent
*
)
event
{
-
(
void
)
deliverJavaMouseEvent
:
(
NSEvent
*
)
event
{
BOOL
isEnabled
=
YES
;
NSWindow
*
window
=
[
self
window
];
if
([
window
isKindOfClass
:
[
AWTWindow
class
]])
{
isEnabled
=
[(
AWTWindow
*
)
window
isEnabled
];
}
if
(
!
isEnabled
)
{
return
;
}
NSEventType
type
=
[
event
type
];
NSEventType
type
=
[
event
type
];
...
...
src/macosx/native/sun/awt/AWTWindow.h
浏览文件 @
8f9460fa
...
@@ -42,6 +42,7 @@
...
@@ -42,6 +42,7 @@
NSSize
javaMinSize
;
NSSize
javaMinSize
;
NSSize
javaMaxSize
;
NSSize
javaMaxSize
;
jint
styleBits
;
jint
styleBits
;
BOOL
isEnabled
;
}
}
@property
(
nonatomic
,
retain
)
JNFWeakJObjectWrapper
*
javaPlatformWindow
;
@property
(
nonatomic
,
retain
)
JNFWeakJObjectWrapper
*
javaPlatformWindow
;
...
@@ -49,6 +50,7 @@
...
@@ -49,6 +50,7 @@
@property
(
nonatomic
)
NSSize
javaMinSize
;
@property
(
nonatomic
)
NSSize
javaMinSize
;
@property
(
nonatomic
)
NSSize
javaMaxSize
;
@property
(
nonatomic
)
NSSize
javaMaxSize
;
@property
(
nonatomic
)
jint
styleBits
;
@property
(
nonatomic
)
jint
styleBits
;
@property
(
nonatomic
)
BOOL
isEnabled
;
-
(
id
)
initWithPlatformWindow
:(
JNFWeakJObjectWrapper
*
)
javaPlatformWindow
-
(
id
)
initWithPlatformWindow
:(
JNFWeakJObjectWrapper
*
)
javaPlatformWindow
styleBits
:(
jint
)
styleBits
styleBits
:(
jint
)
styleBits
...
...
src/macosx/native/sun/awt/AWTWindow.m
浏览文件 @
8f9460fa
...
@@ -58,6 +58,7 @@ static JNF_CLASS_CACHE(jc_CPlatformWindow, "sun/lwawt/macosx/CPlatformWindow");
...
@@ -58,6 +58,7 @@ static JNF_CLASS_CACHE(jc_CPlatformWindow, "sun/lwawt/macosx/CPlatformWindow");
@synthesize
javaMinSize
;
@synthesize
javaMinSize
;
@synthesize
javaMaxSize
;
@synthesize
javaMaxSize
;
@synthesize
styleBits
;
@synthesize
styleBits
;
@synthesize
isEnabled
;
-
(
void
)
updateMinMaxSize
:(
BOOL
)
resizable
{
-
(
void
)
updateMinMaxSize
:(
BOOL
)
resizable
{
if
(
resizable
)
{
if
(
resizable
)
{
...
@@ -157,6 +158,7 @@ AWT_ASSERT_APPKIT_THREAD;
...
@@ -157,6 +158,7 @@ AWT_ASSERT_APPKIT_THREAD;
if
(
self
==
nil
)
return
nil
;
// no hope
if
(
self
==
nil
)
return
nil
;
// no hope
self
.
isEnabled
=
YES
;
self
.
javaPlatformWindow
=
platformWindow
;
self
.
javaPlatformWindow
=
platformWindow
;
self
.
styleBits
=
bits
;
self
.
styleBits
=
bits
;
[
self
setPropertiesForStyleBits
:
styleBits
mask
:
MASK
(
_METHOD_PROP_BITMASK
)];
[
self
setPropertiesForStyleBits
:
styleBits
mask
:
MASK
(
_METHOD_PROP_BITMASK
)];
...
@@ -239,16 +241,15 @@ AWT_ASSERT_APPKIT_THREAD;
...
@@ -239,16 +241,15 @@ AWT_ASSERT_APPKIT_THREAD;
[
super
dealloc
];
[
super
dealloc
];
}
}
// NSWindow overrides
// NSWindow overrides
-
(
BOOL
)
canBecomeKeyWindow
{
-
(
BOOL
)
canBecomeKeyWindow
{
AWT_ASSERT_APPKIT_THREAD
;
AWT_ASSERT_APPKIT_THREAD
;
return
IS
(
self
.
styleBits
,
SHOULD_BECOME_KEY
);
return
self
.
isEnabled
&&
IS
(
self
.
styleBits
,
SHOULD_BECOME_KEY
);
}
}
-
(
BOOL
)
canBecomeMainWindow
{
-
(
BOOL
)
canBecomeMainWindow
{
AWT_ASSERT_APPKIT_THREAD
;
AWT_ASSERT_APPKIT_THREAD
;
return
IS
(
self
.
styleBits
,
SHOULD_BECOME_MAIN
);
return
self
.
isEnabled
&&
IS
(
self
.
styleBits
,
SHOULD_BECOME_MAIN
);
}
}
-
(
BOOL
)
worksWhenModal
{
-
(
BOOL
)
worksWhenModal
{
...
@@ -562,6 +563,27 @@ AWT_ASSERT_APPKIT_THREAD;
...
@@ -562,6 +563,27 @@ AWT_ASSERT_APPKIT_THREAD;
size
->
height
=
MAX
(
size
->
height
,
minHeight
);
size
->
height
=
MAX
(
size
->
height
,
minHeight
);
}
}
-
(
void
)
setEnabled
:
(
BOOL
)
flag
{
self
.
isEnabled
=
flag
;
if
(
IS
(
self
.
styleBits
,
CLOSEABLE
))
{
[[
self
standardWindowButton
:
NSWindowCloseButton
]
setEnabled
:
flag
];
}
if
(
IS
(
self
.
styleBits
,
MINIMIZABLE
))
{
[[
self
standardWindowButton
:
NSWindowMiniaturizeButton
]
setEnabled
:
flag
];
}
if
(
IS
(
self
.
styleBits
,
ZOOMABLE
))
{
[[
self
standardWindowButton
:
NSWindowZoomButton
]
setEnabled
:
flag
];
}
if
(
IS
(
self
.
styleBits
,
RESIZABLE
))
{
[
self
updateMinMaxSize
:
flag
];
[
self
setShowsResizeIndicator
:
flag
];
}
}
@end
// AWTWindow
@end
// AWTWindow
...
@@ -1056,3 +1078,17 @@ JNF_COCOA_EXIT(env);
...
@@ -1056,3 +1078,17 @@ JNF_COCOA_EXIT(env);
return
underMouse
;
return
underMouse
;
}
}
JNIEXPORT
void
JNICALL
Java_sun_lwawt_macosx_CPlatformWindow_nativeSetEnabled
(
JNIEnv
*
env
,
jclass
clazz
,
jlong
windowPtr
,
jboolean
isEnabled
)
{
JNF_COCOA_ENTER
(
env
);
AWTWindow
*
window
=
OBJC
(
windowPtr
);
[
JNFRunLoop
performOnMainThreadWaiting
:
NO
withBlock
:
^
(){
[
window
setEnabled
:
isEnabled
];
}];
JNF_COCOA_EXIT
(
env
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录