summaryrefslogtreecommitdiff
path: root/src/clients
diff options
context:
space:
mode:
Diffstat (limited to 'src/clients')
-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.