fix: prevent fullscreen spaces from wiping workspace assignments on wake#334
Open
strayer wants to merge 1 commit intoacsandmann:mainfrom
Open
fix: prevent fullscreen spaces from wiping workspace assignments on wake#334strayer wants to merge 1 commit intoacsandmann:mainfrom
strayer wants to merge 1 commit intoacsandmann:mainfrom
Conversation
…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.
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.
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.ScreenParametersChangedcycle (validated by confirming the test fails without the fix)Test plan
cargo testpasses (213 tests, including new regression test)