Explorar o código

Handle tray icon being reparented out

Thomas Dy %!s(int64=8) %!d(string=hai) anos
pai
achega
b7a56fefa6
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      src/tray.rs

+ 6 - 0
src/tray.rs

@@ -211,6 +211,12 @@ impl<'a> Tray<'a> {
                 let window = data[2];
                 self.adopt(window);
             },
+            xcb::REPARENT_NOTIFY => {
+                let event: &xcb::ReparentNotifyEvent = xcb::cast_event(&event);
+                if event.parent() != self.window {
+                    self.forget(event.window());
+                }
+            },
             xcb::DESTROY_NOTIFY => {
                 let event: &xcb::DestroyNotifyEvent = xcb::cast_event(&event);
                 self.forget(event.window());