On Thu, 14 Oct 2021 18:22:20 GMT, Alisen Chung <[email protected]> wrote:
>> probably it is possible to save the state of the closed dialog before >> closing it and pass it here? This class is not a public API you can change >> the parameters in these methods. > > I wasn't able to find when or where the dialog ever becomes active, and I > actually think now that it never does become active window. I checked Apple's > documentation on NSPrintPanel and turns out that it doesn't even inherit from > NSPanel nor NSWindow so it can never become a key window (active status). > Looks like it should be safe to not check for active status because a print > dialog popup should block all other windows in the application anyway, so it > will always be "active" window. > > https://developer.apple.com/documentation/appkit/nsprintpanel?language=objc > > This is also the case for page setup and NSPageLayout. > > https://developer.apple.com/documentation/appkit/nspagelayout?language=objc Possible way to test whether the blocker window was active before setBlocked(false) call is to store the information about the blocker when the window is blocked, (i.e. during setBlocked(true) call). Once the window is unblocked you need to check that the blocker was the previous focus owner. As for nativePushNSWindowToFront() call it does not work properly for the case when we have a hierarchy of windows. So I would recommend replacing nativePushNSWindowToFront() with orderAboveSiblings(). ------------- PR: https://git.openjdk.java.net/jdk/pull/5884
