OpenJDK / jdk / jdk
changeset 42721:64c57d4076e6
8140525: AwtFrame::WmShowWindow() may steal focus
Reviewed-by: serb, ssadetsky
author | ant |
---|---|
date | Wed, 23 Nov 2016 18:48:02 +0300 |
parents | 9690e3d8af61 |
children | ab37f3c53f9c |
files | jdk/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp Wed Nov 23 14:28:14 2016 +0530 +++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp Wed Nov 23 18:48:02 2016 +0300 @@ -484,7 +484,10 @@ if (fgProcessID != ::GetCurrentProcessId()) { AwtWindow* window = (AwtWindow*)GetComponent(GetHWnd()); - if (window != NULL && window->IsFocusableWindow() && window->IsAutoRequestFocus() && + if (window != NULL && + window->IsFocusableWindow() && + window->IsAutoRequestFocus() && + !::IsWindowVisible(GetHWnd()) && // the window is really showing !::IsWindow(GetModalBlocker(GetHWnd()))) { // When the Java process is not allowed to set the foreground window