Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
61a45b20
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看板
提交
61a45b20
编写于
1月 19, 2017
作者:
D
dmarkov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8169589: [macosx] Activating a JDialog puts to back another dialog
Reviewed-by: anthony, serb
上级
723b6a08
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
77 addition
and
21 deletion
+77
-21
src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
+67
-21
src/share/classes/java/awt/Window.java
src/share/classes/java/awt/Window.java
+4
-0
src/share/classes/sun/awt/AWTAccessor.java
src/share/classes/sun/awt/AWTAccessor.java
+6
-0
未找到文件。
src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
浏览文件 @
61a45b20
...
@@ -31,6 +31,8 @@ import java.awt.event.*;
...
@@ -31,6 +31,8 @@ import java.awt.event.*;
import
java.awt.peer.WindowPeer
;
import
java.awt.peer.WindowPeer
;
import
java.beans.*
;
import
java.beans.*
;
import
java.lang.reflect.InvocationTargetException
;
import
java.lang.reflect.InvocationTargetException
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.concurrent.atomic.AtomicBoolean
;
import
java.util.concurrent.atomic.AtomicBoolean
;
import
java.util.concurrent.atomic.AtomicLong
;
import
java.util.concurrent.atomic.AtomicLong
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.concurrent.atomic.AtomicReference
;
...
@@ -40,6 +42,8 @@ import java.util.Objects;
...
@@ -40,6 +42,8 @@ import java.util.Objects;
import
javax.swing.*
;
import
javax.swing.*
;
import
sun.awt.*
;
import
sun.awt.*
;
import
sun.awt.AWTAccessor.ComponentAccessor
;
import
sun.awt.AWTAccessor.WindowAccessor
;
import
sun.java2d.SurfaceData
;
import
sun.java2d.SurfaceData
;
import
sun.java2d.opengl.CGLSurfaceData
;
import
sun.java2d.opengl.CGLSurfaceData
;
import
sun.lwawt.*
;
import
sun.lwawt.*
;
...
@@ -1057,31 +1061,73 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
...
@@ -1057,31 +1061,73 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
return
true
;
return
true
;
}
}
private
void
orderAboveSiblings
()
{
private
boolean
isOneOfOwnersOrSelf
(
CPlatformWindow
window
)
{
if
(
owner
==
null
)
{
while
(
window
!=
null
)
{
return
;
if
(
this
==
window
)
{
return
true
;
}
window
=
window
.
owner
;
}
}
return
false
;
}
// NOTE: the logic will fail if we have a hierarchy like:
private
CPlatformWindow
getRootOwner
()
{
// visible root owner
CPlatformWindow
rootOwner
=
this
;
// invisible owner
while
(
rootOwner
.
owner
!=
null
)
{
// visible dialog
rootOwner
=
rootOwner
.
owner
;
// However, this is an unlikely scenario for real life apps
if
(
owner
.
isVisible
())
{
// Recursively pop up the windows from the very bottom so that only
// the very top-most one becomes the main window
owner
.
orderAboveSiblings
();
// Order the window to front of the stack of child windows
owner
.
execute
(
nsWindowOwnerPtr
->{
execute
(
nsWindowSelfPtr
->{
CWrapper
.
NSWindow
.
orderFront
(
nsWindowOwnerPtr
);
CWrapper
.
NSWindow
.
orderWindow
(
nsWindowSelfPtr
,
CWrapper
.
NSWindow
.
NSWindowAbove
,
nsWindowOwnerPtr
);
});
});
}
}
return
rootOwner
;
}
applyWindowLevel
(
target
);
private
void
orderAboveSiblings
()
{
// Recursively pop up the windows from the very bottom, (i.e. root owner) so that
// the windows are ordered above their nearest owner; ancestors of the window,
// which is going to become 'main window', are placed above their siblings.
CPlatformWindow
rootOwner
=
getRootOwner
();
if
(
rootOwner
.
isVisible
())
{
rootOwner
.
execute
(
CWrapper
.
NSWindow
::
orderFront
);
}
final
WindowAccessor
windowAccessor
=
AWTAccessor
.
getWindowAccessor
();
orderAboveSiblingsImpl
(
windowAccessor
.
getOwnedWindows
(
rootOwner
.
target
));
}
private
void
orderAboveSiblingsImpl
(
Window
[]
windows
)
{
ArrayList
<
Window
>
childWindows
=
new
ArrayList
<
Window
>();
final
ComponentAccessor
componentAccessor
=
AWTAccessor
.
getComponentAccessor
();
final
WindowAccessor
windowAccessor
=
AWTAccessor
.
getWindowAccessor
();
// Go through the list of windows and perform ordering.
for
(
Window
w
:
windows
)
{
final
Object
p
=
componentAccessor
.
getPeer
(
w
);
if
(
p
instanceof
LWWindowPeer
)
{
CPlatformWindow
pw
=
(
CPlatformWindow
)((
LWWindowPeer
)
p
).
getPlatformWindow
();
if
(
pw
!=
null
&&
pw
.
isVisible
())
{
// If the window is one of ancestors of 'main window' or is going to become main by itself,
// the window should be ordered above its siblings; otherwise the window is just ordered
// above its nearest parent.
if
(
pw
.
isOneOfOwnersOrSelf
(
this
))
{
pw
.
execute
(
CWrapper
.
NSWindow
::
orderFront
);
}
else
{
pw
.
owner
.
execute
(
ownerPtr
->
{
pw
.
execute
(
ptr
->
{
CWrapper
.
NSWindow
.
orderWindow
(
ptr
,
CWrapper
.
NSWindow
.
NSWindowAbove
,
ownerPtr
);
});
});
}
pw
.
applyWindowLevel
(
w
);
}
}
// Retrieve the child windows for each window from the list and store them for future use.
// Note: we collect data about child windows even for invisible owners, since they may have
// visible children.
childWindows
.
addAll
(
Arrays
.
asList
(
windowAccessor
.
getOwnedWindows
(
w
)));
}
// If some windows, which have just been ordered, have any child windows, let's start new iteration
// and order these child windows.
if
(!
childWindows
.
isEmpty
())
{
orderAboveSiblingsImpl
(
childWindows
.
toArray
(
new
Window
[
0
]));
}
}
}
protected
void
applyWindowLevel
(
Window
target
)
{
protected
void
applyWindowLevel
(
Window
target
)
{
...
...
src/share/classes/java/awt/Window.java
浏览文件 @
61a45b20
...
@@ -4100,6 +4100,10 @@ public class Window extends Container implements Accessible {
...
@@ -4100,6 +4100,10 @@ public class Window extends Container implements Accessible {
public
void
setTrayIconWindow
(
Window
w
,
boolean
isTrayIconWindow
)
{
public
void
setTrayIconWindow
(
Window
w
,
boolean
isTrayIconWindow
)
{
w
.
isTrayIconWindow
=
isTrayIconWindow
;
w
.
isTrayIconWindow
=
isTrayIconWindow
;
}
}
public
Window
[]
getOwnedWindows
(
Window
w
)
{
return
w
.
getOwnedWindows_NoClientCode
();
}
});
// WindowAccessor
});
// WindowAccessor
}
// static
}
// static
...
...
src/share/classes/sun/awt/AWTAccessor.java
浏览文件 @
61a45b20
...
@@ -334,6 +334,12 @@ public final class AWTAccessor {
...
@@ -334,6 +334,12 @@ public final class AWTAccessor {
* Marks the specified window as an utility window for TrayIcon.
* Marks the specified window as an utility window for TrayIcon.
*/
*/
void
setTrayIconWindow
(
Window
w
,
boolean
isTrayIconWindow
);
void
setTrayIconWindow
(
Window
w
,
boolean
isTrayIconWindow
);
/**
* Return an array containing all the windows this
* window currently owns.
*/
Window
[]
getOwnedWindows
(
Window
w
);
}
}
/**
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录