Repository navigation
fix: report the new state in fullscreen events on Windows - #54990
Merged
Merged
Conversation
setFullScreen() told observers before it changed the widget's state, so isFullScreen() still returned the old value inside an enter-full-screen or leave-full-screen listener. The window's last state is still recorded first, which is what the size event handling needs; observers are now told after the change.
deepak1556
approved these changes
Oct 15, 2026
ckerr
approved these changes
Oct 15, 2026
|
Release Notes Persisted
|
This was referenced Oct 15, 2026
Contributor
|
I have automatically backported this PR to "45-x-y", please check out #55008 |
Contributor
|
I have automatically backported this PR to "44-x-y", please check out #55009 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
On Windows,
win.isFullScreen()(andwin.fullScreen) returned the old value inside anenter-full-screenorleave-full-screenlistener, so a listener had to defer a tick before it could read the state it was just told about.NativeWindowViews::SetFullScreen()notified observers before it calledwidget()->SetFullscreen(). The comment there says the order is needed to handle the size event correctly, but whatHandleSizeEvent()reads islast_window_state_, which is still set first. Only the notification moves, to after the widget is in the new state. The path for windows without a thick frame, which resizes to the display instead, notifies after its resize in the same way.One visible consequence: on Windows
resizeis now emitted beforeenter-full-screen/leave-full-screeninstead of after, which matches macOS and Linux.I could not build or run this locally (Windows only); the new spec in the Windows
Fullscreen stateblock reads the state from inside both listeners.Checklist
npm testpassesRelease Notes
Notes: Fixed
win.isFullScreen()being stale in fullscreen events on Windows.