re-subscribe all windows after any change, not individual targets
- SHA
5e0c3e1b881d86335d4fc961f9baf8bd876931aa- Parents
-
0b1a0f9 - Tree
70c9cad
5e0c3e1
5e0c3e1b881d86335d4fc961f9baf8bd876931aa0b1a0f9
70c9cad| Status | File | + | - |
|---|---|---|---|
| M |
src/main.rs
|
8 | 3 |
src/main.rsmodified@@ -306,12 +306,12 @@ fn main() { | ||
| 306 | 306 | } |
| 307 | 307 | } |
| 308 | 308 | |
| 309 | + let mut needs_resubscribe = false; | |
| 309 | 310 | for &wid in &ready { |
| 310 | 311 | pending.remove(&wid); |
| 311 | 312 | if !skip.contains(&wid) { |
| 312 | 313 | borders.add_fresh(wid); |
| 313 | - // Re-subscribe so we get future move/resize events | |
| 314 | - borders.subscribe_target(wid); | |
| 314 | + needs_resubscribe = true; | |
| 315 | 315 | } |
| 316 | 316 | } |
| 317 | 317 | |
@@ -326,9 +326,14 @@ fn main() { | ||
| 326 | 326 | for wid in &resized { |
| 327 | 327 | if borders.overlays.contains_key(wid) { |
| 328 | 328 | borders.recreate(*wid); |
| 329 | - borders.subscribe_target(*wid); | |
| 329 | + needs_resubscribe = true; | |
| 330 | 330 | } |
| 331 | 331 | } |
| 332 | + | |
| 333 | + // Re-subscribe ALL tracked windows (SLSRequestNotificationsForWindows replaces, not appends) | |
| 334 | + if needs_resubscribe || !destroyed.is_empty() { | |
| 335 | + borders.subscribe_all(); | |
| 336 | + } | |
| 332 | 337 | } |
| 333 | 338 | }); |
| 334 | 339 | |