Fix close-persistence and new-window race
Two bugs from user testing:
1. Spawning a new terminal made the border disappear until the next
focus move. Cause: focus moves to the new wid before its SLS state
passes the add_fresh filter (SLSWindowIsOrderedIn race). The
focus-changed branch attempted add_fresh once and gave up; the
focus-unchanged branch returned early, never retrying.
Fix: in update_focus, when front == focused_wid AND the focused
wid still has no overlay, retry add_fresh on every poll. The
filter passes once the new window settles (typically 1-2 ticks).
2. Closing the only window on a workspace left a phantom border.
Cause: sync_overlay returned early on SLSGetWindowBounds failure
(which is what happens for a destroyed wid) without removing the
overlay. The Drop never fired, so NSWindow.orderOut never ran.
Fix: on SLSGetWindowBounds failure, treat the window as gone and
call remove() to drop the overlay.
Also: timer's idle branch now runs reconcile_tracked once per second
as a safety net for any other class of missed Close/Destroy event.
1. Spawning a new terminal made the border disappear until the next
focus move. Cause: focus moves to the new wid before its SLS state
passes the add_fresh filter (SLSWindowIsOrderedIn race). The
focus-changed branch attempted add_fresh once and gave up; the
focus-unchanged branch returned early, never retrying.
Fix: in update_focus, when front == focused_wid AND the focused
wid still has no overlay, retry add_fresh on every poll. The
filter passes once the new window settles (typically 1-2 ticks).
2. Closing the only window on a workspace left a phantom border.
Cause: sync_overlay returned early on SLSGetWindowBounds failure
(which is what happens for a destroyed wid) without removing the
overlay. The Drop never fired, so NSWindow.orderOut never ran.
Fix: on SLSGetWindowBounds failure, treat the window as gone and
call remove() to drop the overlay.
Also: timer's idle branch now runs reconcile_tracked once per second
as a safety net for any other class of missed Close/Destroy event.
Authored by
mfwolffe <wolffemf@dukes.jmu.edu>
- SHA
1319fb0360ef7bd78ea9b104a1e38fdd30d97cc8- Parents
-
2ee2632 - Tree
4acaa8a