Closed Bug 1837007 Opened 1 year ago Closed 1 year ago

Multiple nsCocoaWindows can interfere with each others' native fullscreen requests.

Categories

(Core :: Widget: Cocoa, defect, P3)

Unspecified
macOS
defect

Tracking

()

RESOLVED FIXED
116 Branch
Tracking Status
firefox116 --- fixed

People

(Reporter: bradwerth, Assigned: bradwerth)

References

Details

Attachments

(1 file)

Native fullscreen transitions within a single nsCocoaWindow are serialized via the QueueTransition and ProcessTransitions methods. But when there are multiple windows, there is no coordination between them and it is possible for one window to request fullscreen while a native fullscreen transition is still being processed for another window. In such a case the fullscreen request will fail and the windowDidFailToEnterFullscreen delegate method will be called.

This calling pattern is almost impossible for a user to encounter normally -- it's hard to trigger a fullscreen transition in one window, then switch to another window and trigger another transition before the first is complete. However, this is easily encountered by the test harness and it is possible in theory that complicated web content could encounter this issue.

We can fix this by adding some global state to nsCocoaWindow and running our own event loop when we need to wait for a native fullscreen transition to complete. I'll build a patch that does that.

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.

Pushed by bwerth@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/09ef52ec2299
Part 1: Make nsCocoaWindow run its own event loop when any window is in a native fullscreen transition. r=mstange

Looks like the test browser_fullscreen_from_minimize.js is failing because transitioning to fullscreen sends the fullscreenchange event early, which causes the test to close the window. The patch's new code in DestroyNativeWindow clears the pending transitions so the miniaturize transition is never executed. I'll figure out a fix.

Flags: needinfo?(bwerth)
Pushed by bwerth@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/27e0676b9c09
Part 1: Make nsCocoaWindow run its own event loop when any window is in a native fullscreen transition. r=mstange
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 116 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: