fix: skip inactive-space windows in discovery fallback path#333
fix: skip inactive-space windows in discovery fallback path#333yuukidach wants to merge 2 commits intoacsandmann:mainfrom
Conversation
The AX API returns all windows regardless of Space. The fallback path in emit_layout_events would frame-map these windows to the active Space on the same display, causing all windows to cluster on one screen after a Space switch and sometimes oscillate as the layout re-triggered. Check visible_windows (authoritative, filtered to active spaces) before including a window from the fallback path.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ccf05a1d5f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if let Some(wsid) = state.info.sys_id { | ||
| if !reactor.window_manager.visible_windows.contains(&wsid) { | ||
| continue; |
There was a problem hiding this comment.
Preserve fallback when WS snapshot is empty
In emit_layout_events, this new guard drops any fallback window whose sys_id is not present in visible_windows, but the fallback loop is specifically for cases where the WS snapshot can be empty (see the known_visible fallback comment above). When visible_windows is empty after a SpaceChanged/incomplete WS payload, this condition skips nearly all windows, so no windows are assigned to active spaces and layouts can temporarily go blank or stale until another WS refresh arrives. The active-space filter should only run when visible_windows is known-populated/authoritative for that cycle.
Useful? React with 👍 / 👎.
Only filter fallback windows against visible_windows when the set is non-empty/authoritative. When empty (e.g. after SpaceChanged with an incomplete WS payload), skip the guard so the fallback path can still assign windows to active spaces instead of producing a blank layout.
code changed |
|
To use Codex here, create a Codex account and connect to github. |
Summary
emit_layout_eventsframe-mapped these windows to the active Space on the same displayvisible_windows(authoritatively filtered to active spaces) before including a fallback window, skipping any whose window server ID is not on an active Space