summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortcmal <me@aria.rip>2024-08-25 21:10:02 +0100
committertcmal <me@aria.rip>2024-08-26 15:49:49 +0100
commit19829472eef038c189637d50f4406e54bfe8460e (patch)
tree2123eff17105524148afbefec9ce6d50f0a1cb8c
parent5acbda1ceeac1faa12566cac186ec1a367dd73e0 (diff)
Fix destroy logic being run twice
-rw-r--r--src/clients/mod.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/clients/mod.rs b/src/clients/mod.rs
index 7ea6f48..750a30a 100644
--- a/src/clients/mod.rs
+++ b/src/clients/mod.rs
@@ -88,7 +88,11 @@ impl WM<'_> {
/// Removing destroyed windows from the client list and rearrange.
pub(crate) fn handle_destroy_notify(&mut self, e: &DestroyNotifyEvent) {
- self.clients.unmanage_destroyed(&self.conn, e.window());
+ // destroynotify gets fired twice: one with event = e.window(), and one with event = root
+ // so only listen to the second one
+ if e.event() == self.conn.root() {
+ self.clients.unmanage_destroyed(&self.conn, e.window());
+ }
}
/// Map a window, starting to manage it if needed.