On Thu, 21 Sep 2023 19:10:38 GMT, Kevin Rushforth <k...@openjdk.org> wrote:

> The fix for [JDK-8233678](https://bugs.openjdk.org/browse/JDK-8233678) added 
> a step to the NSApplication initialization to deactivate and then reactivate 
> the application. We trigger the deactivation the first time 
> applicationDidBecomeActive is called. We then trigger the reactivation the 
> when applicationDidResignActive is called after that. The initialization 
> logic in MacApplication spins up a nested event loop that waits for the 
> reactivation (a second call to applicationDidBecomeActive).
> 
> Something in macOS 14 has changed that prevents the initial call to 
> applicationDidBecomeActive from being done until the application has finished 
> launching (notifyDidFinishLaunching).
> 
> So the activation of the NSApplication is waiting for the launching to be 
> finished, but the nested event loop we spin up is blocking the completion of 
> launching until we get the activation. This is a classic deadlock.
> 
> The good news, though, is the deactivation / reactivation of the application 
> no longer seems to be needed on macOS 14. The menus work fine without that 
> fix.
> 
> The proposed solution is to check the version of macOS and only enable the 
> deactivation / reactivation logic on systems prior to macOS 14. This will 
> have the additional benefit of avoiding the brief flash when the app is first 
> launched (see [JDK-8257835](https://bugs.openjdk.org/browse/JDK-8257835)).
> 
> This is a Draft PR with a few debugging statements. Once I get some feedback 
> that it works for more than just me, I'll remove the debugging statements and 
> then make it "rfr".

I do not have access to a system with 10.14.
Code changes look reasonable. Approving based on this assumption and fix 
confirmation by others in this PR.

-------------

Marked as reviewed by aghaisas (Reviewer).

PR Review: https://git.openjdk.org/jfx/pull/1247#pullrequestreview-1644049978

Reply via email to