Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/actor/reactor/events/window_discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,19 @@ impl WindowDiscoveryHandler {
let Some(state) = reactor.window_manager.windows.get(&wid) else {
continue;
};

// The AX API returns all windows regardless of which Space they are
// on. Windows on inactive Spaces whose frames overlap an active
// display would be frame-mapped to the active Space on that display,
// causing every window to cluster on one screen after a Space switch.
// Guard against this by skipping windows the window server confirms
// are NOT on any active Space.
if let Some(wsid) = state.info.sys_id {
if !reactor.window_manager.visible_windows.contains(&wsid) {
continue;
Comment on lines +381 to +385
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

}
}

let Some(space) =
reactor.best_space_for_window(&state.frame_monotonic, state.info.sys_id)
else {
Expand Down
Loading