gardesk/ers / 5e0c3e1

Browse files

re-subscribe all windows after any change, not individual targets

Authored by espadonne
SHA
5e0c3e1b881d86335d4fc961f9baf8bd876931aa
Parents
0b1a0f9
Tree
70c9cad

1 changed file

StatusFile+-
M src/main.rs 8 3
src/main.rsmodified
@@ -306,12 +306,12 @@ fn main() {
306306
                 }
307307
             }
308308
 
309
+            let mut needs_resubscribe = false;
309310
             for &wid in &ready {
310311
                 pending.remove(&wid);
311312
                 if !skip.contains(&wid) {
312313
                     borders.add_fresh(wid);
313
-                    // Re-subscribe so we get future move/resize events
314
-                    borders.subscribe_target(wid);
314
+                    needs_resubscribe = true;
315315
                 }
316316
             }
317317
 
@@ -326,9 +326,14 @@ fn main() {
326326
             for wid in &resized {
327327
                 if borders.overlays.contains_key(wid) {
328328
                     borders.recreate(*wid);
329
-                    borders.subscribe_target(*wid);
329
+                    needs_resubscribe = true;
330330
                 }
331331
             }
332
+
333
+            // Re-subscribe ALL tracked windows (SLSRequestNotificationsForWindows replaces, not appends)
334
+            if needs_resubscribe || !destroyed.is_empty() {
335
+                borders.subscribe_all();
336
+            }
332337
         }
333338
     });
334339