Skip to content

fix: prevent fullscreen spaces from wiping workspace assignments on wake#334

Open
strayer wants to merge 1 commit intoacsandmann:mainfrom
strayer:fix/fullscreen-sleep-wake-workspace-reset
Open

fix: prevent fullscreen spaces from wiping workspace assignments on wake#334
strayer wants to merge 1 commit intoacsandmann:mainfrom
strayer:fix/fullscreen-sleep-wake-workspace-reset

Conversation

@strayer
Copy link
Copy Markdown

@strayer strayer commented Apr 3, 2026

Summary

Fixes #308 — windows were incorrectly reset to Workspace 1 upon wake from sleep when a fullscreen video was active.

The previous fix (fa56a8c) only prevented topology relayout detection and display-history remapping for fullscreen spaces, but the fullscreen space still flowed through the rest of handle_screen_parameters_changed: it was stored as the screen's active space, had fresh workspaces created for it, and had windows assigned to those new workspaces. When the user later exited fullscreen, all prior workspace assignments were lost.

The fix nulls out fullscreen spaces at the top of handle_screen_parameters_changed, before they can be stored or processed. This way the reactor treats a fullscreen space as "no space info available" and preserves all existing workspace state.

  • Adds debug logging when a fullscreen space is nulled out
  • Adds a regression test that verifies window layout is preserved across a fullscreen ScreenParametersChanged cycle (validated by confirming the test fails without the fix)

Disclaimer: The root cause analysis and fix were produced by Claude Code (Opus 4.6), guided and verified by the PR author.

Test plan

…ake (acsandmann#308)

When ScreenParametersChanged fires after waking from sleep with a
fullscreen app active, macOS reports the fullscreen space ID as the
active space. The previous fix (fa56a8c) only prevented topology
relayout detection and display-history remapping for fullscreen spaces,
but the fullscreen space still flowed through the rest of the handler:
it was stored as the screen's active space, had fresh workspaces
created for it, and had windows assigned to those new workspaces.

When the user later exited fullscreen and the original user space
became active again, all prior workspace assignments were lost and
windows ended up on Workspace 1.

The fix nulls out fullscreen spaces at the top of
handle_screen_parameters_changed, before they can be stored or
processed. This way the reactor treats a fullscreen space as "no space
info available" and preserves all existing workspace state.

Also adds a regression test that verifies window layout is preserved
across a fullscreen ScreenParametersChanged cycle, and debug logging
when a fullscreen space is nulled out.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows incorrectly reset to Workspace 1 upon wake from sleep when fullscreen video is active

1 participant