Bug 1837007 Part 1: Make nsCocoaWindow run its own event loop when any window is...
commite6b23c62aed774550afc6728bc8ceba25af0fc1e
authorBrad Werth <bwerth@mozilla.com>
Thu, 8 Jun 2023 20:37:42 +0000 (8 20:37 +0000)
committerBrad Werth <bwerth@mozilla.com>
Thu, 8 Jun 2023 20:37:42 +0000 (8 20:37 +0000)
treeb8fbdf998922cd783a80172319130b252ca7125e
parentce144701bb353c3f1c845b86aab029218330f568
Bug 1837007 Part 1: Make nsCocoaWindow run its own event loop when any window is in a native fullscreen transition. r=mstange

This code runs its own event loop during a native fullscreen transition in
3 places:

1) In ProcessTransitions() when attempting to enter native fullscreen.
2) In ProcessTransitions() when attempting to exit native fullscreen.
3) In DestroyNativeWindow().

This ensures that queued native fullscreen transitions (not user-generated
ones) will succeed, even if multiple windows are transitioning to/from
native fullscreen or being closed while in fullscreen.

This added code is only run for programmatic fullscreen transitions. It
has no knowledge of user-initiated actions. This means that if a user is
manually toggling fullscreen while programmatic actions are being
proceessed, it's still possible for a fullscreen transition to fail.

Differential Revision: https://phabricator.services.mozilla.com/D180121
widget/cocoa/nsCocoaWindow.h
widget/cocoa/nsCocoaWindow.mm