From 34b2a6dde9698f7383db513c4e386d11ccc34b27 Mon Sep 17 00:00:00 2001 From: Dmitry Markov Date: Thu, 6 Dec 2018 13:32:15 +0000 Subject: [PATCH] =?UTF-8?q?8213983:=20[macosx]=20Keyboard=20shortcut=20?= =?UTF-8?q?=E2=80=9Ccmd=20+`=E2=80=9D=20stops=20working=20properly=20if=20?= =?UTF-8?q?popup=20window=20is=20displayed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: kaddepalli, serb --- .../sun/lwawt/macosx/CPlatformWindow.java | 23 ++++++------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java index 27f2f43744d..06ee0a64bdc 100644 --- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java +++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java @@ -1264,27 +1264,18 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo } 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.isIconified() && !rootOwner.isActive()) { + rootOwner.execute(CWrapper.NSWindow::orderFront); + } // Do not order child windows of iconified owner. if (!rootOwner.isIconified()) { final WindowAccessor windowAccessor = AWTAccessor.getWindowAccessor(); - Window[] windows = windowAccessor.getOwnedWindows(rootOwner.target); - - // No need to order windows if it doesn't own other windows and hence return - if (windows.length == 0) { - return; - } - - // 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. - if (rootOwner.isVisible()) { - rootOwner.execute(CWrapper.NSWindow::orderFront); - } - - // Order child windows. - orderAboveSiblingsImpl(windows); + orderAboveSiblingsImpl(windowAccessor.getOwnedWindows(rootOwner.target)); } }