gardesk/ers / 53ea64d

Browse files

Drop CanJoinAllSpaces; log focus and hide/unhide calls

Overlays were leaking onto every macOS space simultaneously due to
CanJoinAllSpaces, which presents as 'border stuck on the previous
workspace' when the user navigates between tarmac workspaces. Removing
that flag confines each overlay to the space where it was created.

Add diagnostic logging in update_focus / hide / unhide so a workspace-
switch trace can be read with RUST_LOG=ers=debug.
Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
53ea64d35adb00d31784c6f489337d94c9ac256f
Parents
e209766
Tree
34cf11d

2 changed files

StatusFile+-
M src/main.rs 8 1
M src/nswindow_overlay.rs 5 2
src/main.rsmodified
@@ -460,12 +460,14 @@ impl BorderMap {
460460
 
461461
     fn hide(&self, target_wid: u32) {
462462
         if let Some(o) = self.overlays.get(&target_wid) {
463
+            debug!("[hide] target={} overlay_wid={}", target_wid, o.wid());
463464
             o.window.order_out();
464465
         }
465466
     }
466467
 
467468
     fn unhide(&self, target_wid: u32) {
468469
         if let Some(o) = self.overlays.get(&target_wid) {
470
+            debug!("[unhide] target={} overlay_wid={}", target_wid, o.wid());
469471
             o.window.order_above(target_wid);
470472
         }
471473
     }
@@ -506,7 +508,12 @@ impl BorderMap {
506508
 
507509
         let old = self.focused_wid;
508510
         self.focused_wid = front;
509
-        debug!("[focus] {} -> {}", old, front);
511
+        debug!(
512
+            "[focus] {} -> {} (tracked targets: {:?})",
513
+            old,
514
+            front,
515
+            self.overlays.keys().collect::<Vec<_>>()
516
+        );
510517
 
511518
         // Pull both overlays' positions to the targets' current SLS bounds
512519
         // before un/hiding. AX-driven moves during a stack cycle frequently
src/nswindow_overlay.rsmodified
@@ -103,9 +103,12 @@ impl OverlayWindow {
103103
         window.setLevel(NS_FLOATING_WINDOW_LEVEL);
104104
         unsafe { window.setReleasedWhenClosed(false) };
105105
         window.setSharingType(NSWindowSharingType::None);
106
+        // Do NOT set CanJoinAllSpaces: that would draw the overlay on
107
+        // every macOS space simultaneously. tarmac's workspaces are
108
+        // not macOS spaces, but if the user has both, leaking onto
109
+        // every space looks like a "stuck border" bug.
106110
         window.setCollectionBehavior(
107
-            NSWindowCollectionBehavior::CanJoinAllSpaces
108
-                | NSWindowCollectionBehavior::Stationary
111
+            NSWindowCollectionBehavior::Stationary
109112
                 | NSWindowCollectionBehavior::IgnoresCycle
110113
                 | NSWindowCollectionBehavior::FullScreenAuxiliary,
111114
         );