Skip to content

fix: report the new state in fullscreen events on Windows - #54990

Merged
ckerr merged 1 commit into
mainfrom
fix/win-isfullscreen-in-events
Oct 15, 2026
Merged

ckerr merged 1 commit into
mainfrom
fix/win-isfullscreen-in-events

Conversation

@codebytere

@codebytere codebytere commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Description of Change

On Windows, win.isFullScreen() (and win.fullScreen) returned the old value inside an enter-full-screen or leave-full-screen listener, 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 called widget()->SetFullscreen(). The comment there says the order is needed to handle the size event correctly, but what HandleSizeEvent() reads is last_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 resize is now emitted before enter-full-screen / leave-full-screen instead of after, which matches macOS and Linux.

I could not build or run this locally (Windows only); the new spec in the Windows Fullscreen state block reads the state from inside both listeners.

Checklist

Release Notes

Notes: Fixed win.isFullScreen() being stale in fullscreen events on Windows.

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.
@codebytere codebytere added semver/patch backwards-compatible bug fixes target/44-x-y PR should also be added to the "44-x-y" branch. target/45-x-y PR should also be added to the "45-x-y" branch. labels Oct 15, 2026
@ckerr
ckerr merged commit 876e9ca into main Oct 15, 2026
93 checks passed
@release-clerk

release-clerk Bot commented Oct 15, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed win.isFullScreen() being stale in fullscreen events on Windows.

@trop

trop Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "45-x-y", please check out #55008

@trop

trop Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "44-x-y", please check out #55009

@trop trop Bot added in-flight/44-x-y merged/44-x-y PR was merged to the "44-x-y" branch. merged/45-x-y PR was merged to the "45-x-y" branch. and removed target/45-x-y PR should also be added to the "45-x-y" branch. target/44-x-y PR should also be added to the "44-x-y" branch. in-flight/44-x-y in-flight/45-x-y labels Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

46-x-y merged/44-x-y PR was merged to the "44-x-y" branch. merged/45-x-y PR was merged to the "45-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants