Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
f51976f7
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看板
提交
f51976f7
编写于
2月 17, 2009
作者:
D
dcherepanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6769607: PIT : Modal frame hangs for a while for few seconds in 6u12 b01 pit build
Reviewed-by: art, anthony
上级
027bedd6
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
64 addition
and
45 deletion
+64
-45
src/share/classes/java/awt/Window.java
src/share/classes/java/awt/Window.java
+3
-3
src/windows/native/sun/windows/awt_Dialog.cpp
src/windows/native/sun/windows/awt_Dialog.cpp
+58
-42
src/windows/native/sun/windows/awt_Dialog.h
src/windows/native/sun/windows/awt_Dialog.h
+3
-0
未找到文件。
src/share/classes/java/awt/Window.java
浏览文件 @
f51976f7
...
...
@@ -687,9 +687,9 @@ public class Window extends Container implements Accessible {
}
if
(
peer
==
null
)
{
peer
=
getToolkit
().
createWindow
(
this
);
synchronized
(
allWindows
)
{
allWindows
.
add
(
this
);
}
}
synchronized
(
allWindows
)
{
allWindows
.
add
(
this
);
}
super
.
addNotify
();
}
...
...
src/windows/native/sun/windows/awt_Dialog.cpp
浏览文件 @
f51976f7
...
...
@@ -230,25 +230,8 @@ LRESULT CALLBACK AwtDialog::ModalFilterProc(int code,
if
(
::
IsIconic
(
hWnd
))
{
::
ShowWindow
(
hWnd
,
SW_RESTORE
);
}
HWND
topMostBlocker
=
blocker
;
HWND
toolkitHWnd
=
AwtToolkit
::
GetInstance
().
GetHWnd
();
while
(
::
IsWindow
(
blocker
))
{
topMostBlocker
=
blocker
;
// fix for 6494032: restore the blocker if it was minimized
// together with its parent frame; in such cases the check
// ::IsIconic() for the blocker returns false, so we use
// ::IsWindowVisible() instead
if
(
!::
IsWindowVisible
(
topMostBlocker
)
&&
(
topMostBlocker
!=
toolkitHWnd
))
{
::
ShowWindow
(
topMostBlocker
,
SW_SHOWNA
);
}
::
BringWindowToTop
(
blocker
);
blocker
=
AwtWindow
::
GetModalBlocker
(
blocker
);
}
if
(
topMostBlocker
!=
toolkitHWnd
)
{
::
SetForegroundWindow
(
topMostBlocker
);
}
PopupAllDialogs
(
blocker
,
TRUE
,
::
GetForegroundWindow
(),
FALSE
);
// return 1 to prevent the system from allowing the operation
return
1
;
}
return
CallNextHookEx
(
0
,
code
,
wParam
,
lParam
);
...
...
@@ -271,30 +254,11 @@ LRESULT CALLBACK AwtDialog::MouseHookProc(int nCode,
(
wParam
==
WM_NCRBUTTONDOWN
))
{
HWND
blocker
=
AwtWindow
::
GetModalBlocker
(
AwtComponent
::
GetTopLevelParentForWindow
(
hWnd
));
HWND
topMostBlocker
=
blocker
;
HWND
prevForegroundWindow
=
::
GetForegroundWindow
();
if
(
::
IsWindow
(
blocker
))
{
::
BringWindowToTop
(
hWnd
);
}
while
(
::
IsWindow
(
blocker
))
{
topMostBlocker
=
blocker
;
::
BringWindowToTop
(
blocker
);
blocker
=
AwtWindow
::
GetModalBlocker
(
blocker
);
}
if
(
::
IsWindow
(
topMostBlocker
))
{
// no beep/flash if the mouse was clicked in the taskbar menu
// or the dialog is currently inactive
if
((
::
WindowFromPoint
(
mhs
->
pt
)
==
hWnd
)
&&
(
prevForegroundWindow
==
topMostBlocker
))
{
::
MessageBeep
(
MB_OK
);
// some heuristics: 3 times x 64 milliseconds
AwtWindow
::
FlashWindowEx
(
topMostBlocker
,
3
,
64
,
FLASHW_CAPTION
);
}
if
(
topMostBlocker
!=
AwtToolkit
::
GetInstance
().
GetHWnd
())
{
::
BringWindowToTop
(
topMostBlocker
);
::
SetForegroundWindow
(
topMostBlocker
);
}
BOOL
onTaskbar
=
!
(
::
WindowFromPoint
(
mhs
->
pt
)
==
hWnd
);
PopupAllDialogs
(
hWnd
,
FALSE
,
::
GetForegroundWindow
(),
onTaskbar
);
// return a nonzero value to prevent the system from passing
// the message to the target window procedure
return
1
;
}
}
...
...
@@ -303,6 +267,58 @@ LRESULT CALLBACK AwtDialog::MouseHookProc(int nCode,
return
CallNextHookEx
(
0
,
nCode
,
wParam
,
lParam
);
}
/*
* The function goes through the heirarchy of the blocker dialogs and
* popups all the dialogs. Note that the function starts from the top
* blocker dialog and goes down to the dialog which is the bottom dialog.
* Using another traversal may cause to the flickering issue as a bottom
* dialog will cover a top dialog for some period of time.
*/
void
AwtDialog
::
PopupAllDialogs
(
HWND
dialog
,
BOOL
isModalHook
,
HWND
prevFGWindow
,
BOOL
onTaskbar
)
{
HWND
blocker
=
AwtWindow
::
GetModalBlocker
(
dialog
);
BOOL
isBlocked
=
::
IsWindow
(
blocker
);
if
(
isBlocked
)
{
PopupAllDialogs
(
blocker
,
isModalHook
,
prevFGWindow
,
onTaskbar
);
}
PopupOneDialog
(
dialog
,
blocker
,
isModalHook
,
prevFGWindow
,
onTaskbar
);
}
/*
* The function popups the dialog, it distinguishes non-blocked dialogs
* and activates the dialogs (sets as foreground window). If the dialog is
* blocked, then it changes the Z-order of the dialog.
*/
void
AwtDialog
::
PopupOneDialog
(
HWND
dialog
,
HWND
blocker
,
BOOL
isModalHook
,
HWND
prevFGWindow
,
BOOL
onTaskbar
)
{
if
(
dialog
==
AwtToolkit
::
GetInstance
().
GetHWnd
())
{
return
;
}
// fix for 6494032
if
(
isModalHook
&&
!::
IsWindowVisible
(
dialog
))
{
::
ShowWindow
(
dialog
,
SW_SHOWNA
);
}
BOOL
isBlocked
=
::
IsWindow
(
blocker
);
UINT
flags
=
SWP_NOACTIVATE
|
SWP_NOMOVE
|
SWP_NOSIZE
;
if
(
isBlocked
)
{
::
SetWindowPos
(
dialog
,
blocker
,
0
,
0
,
0
,
0
,
flags
);
}
else
{
::
SetWindowPos
(
dialog
,
HWND_TOP
,
0
,
0
,
0
,
0
,
flags
);
// no beep/flash if the mouse was clicked in the taskbar menu
// or the dialog is currently inactive
if
(
!
isModalHook
&&
!
onTaskbar
&&
(
dialog
==
prevFGWindow
))
{
::
MessageBeep
(
MB_OK
);
// some heuristics: 3 times x 64 milliseconds
AwtWindow
::
FlashWindowEx
(
dialog
,
3
,
64
,
FLASHW_CAPTION
);
}
::
BringWindowToTop
(
dialog
);
::
SetForegroundWindow
(
dialog
);
}
}
LRESULT
CALLBACK
AwtDialog
::
MouseHookProc_NonTT
(
int
nCode
,
WPARAM
wParam
,
LPARAM
lParam
)
{
...
...
src/windows/native/sun/windows/awt_Dialog.h
浏览文件 @
f51976f7
...
...
@@ -113,6 +113,9 @@ private:
*/
static
void
ModalPerformActivation
(
HWND
hWnd
);
static
void
PopupAllDialogs
(
HWND
dialog
,
BOOL
isModalHook
,
HWND
prevFGWindow
,
BOOL
onTaskbar
);
static
void
PopupOneDialog
(
HWND
dialog
,
HWND
blocker
,
BOOL
isModalHook
,
HWND
prevFGWindow
,
BOOL
onTaskbar
);
public:
// WH_CBT hook procedure used in modality, prevents modal
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录