systray: Process XEmbed events according to spec

This commit is contained in:
o9000
2015-07-16 21:08:29 +02:00
parent 68c3205b53
commit 227dc8e48a
3 changed files with 127 additions and 135 deletions

View File

@@ -1280,6 +1280,22 @@ start:
case PropertyNotify:
event_property_notify(&e);
if (e.xproperty.atom == server.atom._XEMBED_INFO) {
if (systray_profile)
fprintf(stderr, "XEMBED event\n");
for (it = systray.list_icons; it; it = g_slist_next(it)) {
TrayWindow *traywin = (TrayWindow*)it->data;
if (traywin->win == e.xany.window) {
if (!traywin->embedding_finalized) {
finalize_embedding_icon(traywin);
} else {
if (!icon_embedded(traywin))
remove_icon(traywin);
}
break;
}
}
}
break;
case ConfigureNotify:
@@ -1287,7 +1303,6 @@ start:
break;
case ReparentNotify:
fprintf(stderr, "ReparentNotify\n");
if (!systray_enabled)
break;
panel = (Panel*)systray.area.panel;
@@ -1296,8 +1311,10 @@ start:
for (it = systray.list_icons; it; it = g_slist_next(it)) {
TrayWindow *traywin = (TrayWindow*)it->data;
if (traywin->win == e.xreparent.window) {
if (systray_profile)
fprintf(stderr, "ReparentNotify\n");
if (traywin->parent == e.xreparent.parent) {
embed_icon(traywin);
start_embedding_icon(traywin);
} else {
remove_icon(traywin);
}