JDK-8165157 : [macosx] modal dialog is shown before it is expected
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 9
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: os_x
  • Submitted: 2016-08-31
  • Updated: 2019-03-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Description
In Dialog.conditionalShow() there's the following logic: 

if (modal) { 
  ... 
  modalShow(); 
} 
... 
peer.setVisible(true); 

Then: 

modalShow() -> blockWindows() -> peer.blockWindows() -> LWWindowPeer.setModalBlocked() -> CPlatformWindow.setModalBlocked() -> checkBlockingAndOrder() -> 

        CWrapper.NSWindow.orderFrontRegardless(nsWindowPtr); 
        CWrapper.NSWindow.makeKeyAndOrderFront(nsWindowPtr); 
        CWrapper.NSWindow.makeMainWindow(nsWindowPtr); 

This actually shows the platform window, before peer.setVisible(true) is called.

This seems unexpected and is a potential source of issues (like 8160570).
Comments
Please find the test in the Description of JDK-8160570. This test has just been pushed to jdk9: test/java/awt/Focus/ModalDialogActivationTest/ModalDialogActivationTest.java
08-09-2016

Hi Anton, Please provide any test case to reproduce the problem.
06-09-2016