diff --git a/src/wayland/mod.rs b/src/wayland/mod.rs index acc449c..425d5ab 100644 --- a/src/wayland/mod.rs +++ b/src/wayland/mod.rs @@ -163,6 +163,12 @@ impl Dispatch for AppState { } } }, + zwlr_foreign_toplevel_handle_v1::Event::Closed => { + // Clean up when toplevel is closed + if let Ok(mut apps) = TOPLEVEL_APPS.lock() { + apps.remove(&handle_id); + } + }, _ => {}, } }