Route discovered windows to their actual monitor's workspace
discover_and_observe was sending every discovered window through
add_window_to_active without specifying a target workspace, so each
window landed in active_workspace_mut() — the workspace on the
monitor under the cursor at startup. Windows on other monitors got
inserted into the cursor monitor's BSP tree, then apply_layout asked
AX to move them across displays; some apps (Ghostty especially)
either reject or race that cross-display move and stay physically on
their original monitor while remaining logically in the wrong
workspace's tree. Visible to the user as 'two windows reachable via
stack-cycle but never joining the tile.'
Fix is local to the discovery loop: compute each window's monitor
from its center point and temporarily set focused_monitor to that
monitor for the duration of the add_window_to_active call. Restore
focused_monitor after the loop. add_window_to_active itself is
unchanged, so the rule path and runtime Created path keep working
exactly as before.
Refs memory observation #2542.
add_window_to_active without specifying a target workspace, so each
window landed in active_workspace_mut() — the workspace on the
monitor under the cursor at startup. Windows on other monitors got
inserted into the cursor monitor's BSP tree, then apply_layout asked
AX to move them across displays; some apps (Ghostty especially)
either reject or race that cross-display move and stay physically on
their original monitor while remaining logically in the wrong
workspace's tree. Visible to the user as 'two windows reachable via
stack-cycle but never joining the tile.'
Fix is local to the discovery loop: compute each window's monitor
from its center point and temporarily set focused_monitor to that
monitor for the duration of the add_window_to_active call. Restore
focused_monitor after the loop. add_window_to_active itself is
unchanged, so the rule path and runtime Created path keep working
exactly as before.
Refs memory observation #2542.
Authored by
mfwolffe <wolffemf@dukes.jmu.edu>
- SHA
da1c0948b29b641b434e6b4c3f83819a44fec101- Parents
-
b9e6405 - Tree
74075ea