systray: remove icon when reparented away from us

This commit is contained in:
o9000 2015-07-16 20:27:01 +02:00
parent c606a1a35a
commit 61f0a4ec85

View file

@ -1291,16 +1291,15 @@ start:
if (!systray_enabled) if (!systray_enabled)
break; break;
panel = (Panel*)systray.area.panel; panel = (Panel*)systray.area.panel;
if (e.xany.window == panel->main_win) // reparented to us if (e.xany.window == panel->main_win) // don't care
break; break;
// FIXME: 'reparent to us' badly detected => disabled
for (it = systray.list_icons; it; it = g_slist_next(it)) { for (it = systray.list_icons; it; it = g_slist_next(it)) {
TrayWindow *traywin = (TrayWindow*)it->data; TrayWindow *traywin = (TrayWindow*)it->data;
if (traywin->win == e.xreparent.window) { if (traywin->win == e.xreparent.window) {
fprintf(stderr, "win\n");
if (traywin->parent == e.xreparent.parent) { if (traywin->parent == e.xreparent.parent) {
fprintf(stderr, "parent\n");
embed_icon(traywin); embed_icon(traywin);
} else {
remove_icon(traywin);
} }
break; break;
} }