codebytere

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

Merged
Created: Oct 15, 2026, 1:13:10 AM
Merged: Oct 15, 2026, 8:25:47 AM
3 comments
Target: main

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.

Backports

44-x-y
Merged
PR Number
#55009
Merged At
Oct 15, 2026, 9:28:51 AM
Released In
Not yet
Release Date
Not yet
45-x-y
Merged
PR Number
#55008
Merged At
Oct 15, 2026, 9:28:59 AM
Released In
Not yet
Release Date
Not yet

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron