xembed: Handle reparents correctly

The Xembed specification states that the protocol ends by reparenting the
embedded window elsewhere while unmapping the window can be done without ending
the protocol.

This commit makes us follow this part of the spec.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2016-05-14 14:20:08 +02:00
parent e8da309cf1
commit a42762493a
1 changed files with 10 additions and 8 deletions

18
event.c
View File

@ -770,14 +770,6 @@ event_handle_unmapnotify(xcb_unmap_notify_event_t *ev)
if((c = client_getbywin(ev->window)))
client_unmanage(c, true);
else
for(int i = 0; i < globalconf.embedded.len; i++)
if(globalconf.embedded.tab[i].win == ev->window)
{
xembed_window_array_take(&globalconf.embedded, i);
xcb_change_save_set(globalconf.connection, XCB_SET_MODE_DELETE, ev->window);
luaA_systray_invalidate();
}
}
/** The randr screen change notify event handler.
@ -918,6 +910,16 @@ event_handle_reparentnotify(xcb_reparent_notify_event_t *ev)
if (ev->parent != globalconf.screen->root)
client_unmanage(c, true);
}
else if (ev->parent != globalconf.systray.window) {
/* Embedded window moved elsewhere, end of embedding */
for(int i = 0; i < globalconf.embedded.len; i++)
if(globalconf.embedded.tab[i].win == ev->window)
{
xembed_window_array_take(&globalconf.embedded, i);
xcb_change_save_set(globalconf.connection, XCB_SET_MODE_DELETE, ev->window);
luaA_systray_invalidate();
}
}
}
static void