gardesk/ers / 0597a14

Browse files

Refresh overlay bounds on focus change before hide/unhide

AX-driven window moves during stack cycles often don't emit SLS
WINDOW_MOVE notifications, so the stored overlay frame can be stale
when update_focus runs. Calling sync_overlay against the live
SLSGetWindowBounds for both old and new focused windows before the
hide/unhide pair keeps the active border on the right window during
stack-next/prev navigation.
Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
0597a14465fd4189896aee0676273480ae57327a
Parents
40e1370
Tree
c503d5a

1 changed file

StatusFile+-
M src/main.rs 8 0
src/main.rsmodified
@@ -546,6 +546,14 @@ impl BorderMap {
546546
         self.focused_wid = front;
547547
         debug!("[focus] {} -> {}", old, front);
548548
 
549
+        // Pull both overlays' positions to the targets' current SLS bounds
550
+        // before un/hiding. AX-driven moves during a stack cycle frequently
551
+        // don't fire SLS WINDOW_MOVE notifications, so a stored overlay
552
+        // can be at stale coordinates. SLSGetWindowBounds (inside
553
+        // sync_overlay) is real-time and doesn't wait for a notification.
554
+        self.sync_overlay(old);
555
+        self.sync_overlay(front);
556
+
549557
         if self.active_only {
550558
             self.hide(old);
551559
             self.unhide(front);