gardesk/ers / 6cba17f

Browse files

Don't re-order hidden overlays on geometry sync

orderWindow:relativeTo: re-shows an off-screen window as a side effect.
sync_overlay called order_above whenever a target's bounds changed, which
defeated active_only mode for stacked windows: tarmac's stack peek-out
positions shift on every stack cycle, so each non-focused stack overlay
popped back onto the screen as a grey border.
Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
6cba17f48f98f2baf73494338a81a7c2b830f5c1
Parents
1319fb0
Tree
dd13636

1 changed file

StatusFile+-
M src/main.rs 11 1
src/main.rsmodified
@@ -427,6 +427,9 @@ impl BorderMap {
427427
             }
428428
         }
429429
 
430
+        let active_only = self.active_only;
431
+        let focused = self.focused_wid;
432
+
430433
         if let Some(overlay) = self.overlays.get_mut(&target_wid) {
431434
             let prev = overlay.bounds();
432435
             if size_changed(prev, bounds) || origin_changed(prev, bounds) {
@@ -448,7 +451,14 @@ impl BorderMap {
448451
                     bounds.size.width,
449452
                     bounds.size.height,
450453
                 );
451
-                overlay.window.order_above(target_wid);
454
+                // orderWindow:relativeTo: re-shows an off-screen window
455
+                // as a side effect. In active_only mode, non-focused
456
+                // overlays must remain hidden — otherwise stack peek
457
+                // positions cause every stacked window's overlay to
458
+                // pop onto the screen as their bounds shift.
459
+                if !active_only || target_wid == focused {
460
+                    overlay.window.order_above(target_wid);
461
+                }
452462
             }
453463
         }
454464