8185429: [macos] After a modal dialog is closed, no window becomes active

Reviewed-by: tr, dnguyen, serb
This commit is contained in:
Alisen Chung 2024-06-25 02:19:57 +00:00
parent 4b153e5e05
commit 3a26bbcebc
2 changed files with 7 additions and 2 deletions
src/java.desktop/macosx/classes/sun/lwawt/macosx
test/jdk

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -64,6 +64,7 @@ import sun.awt.AWTAccessor;
import sun.awt.AWTAccessor.ComponentAccessor;
import sun.awt.AWTAccessor.WindowAccessor;
import sun.java2d.SurfaceData;
import sun.lwawt.LWKeyboardFocusManagerPeer;
import sun.lwawt.LWLightweightFramePeer;
import sun.lwawt.LWToolkit;
import sun.lwawt.LWWindowPeer;
@ -1056,6 +1057,11 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
}
execute(ptr -> nativeSetEnabled(ptr, !blocked));
Window currFocus = LWKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow();
if (!blocked && (target == currFocus)) {
requestWindowFocus();
}
checkBlockingAndOrder();
}

@ -781,7 +781,6 @@ java/awt/Modal/PrintDialogsTest/PrintDialogsTest.java 8068378 generic-all
java/awt/event/MouseEvent/AltGraphModifierTest/AltGraphModifierTest.java 8162380 generic-all
java/awt/image/VolatileImage/VolatileImageConfigurationTest.java 8171069 macosx-all,linux-all
java/awt/Modal/InvisibleParentTest/InvisibleParentTest.java 8172245 linux-all
java/awt/print/Dialog/RestoreActiveWindowTest/RestoreActiveWindowTest.java 8185429 macosx-all
java/awt/Frame/FrameStateTest/FrameStateTest.java 8203920 macosx-all,linux-all
java/awt/print/PrinterJob/ScaledText/ScaledText.java 8231226 macosx-all
java/awt/font/TextLayout/TestJustification.java 8250791 macosx-all