don't release clients reparented somewhere else

this broke re-embedding clients

XReparentWindow causes an unmap of mapped clients, currently leading into releaseClient()
This will (among other) eg. reparent the client to the root and this is (usually?) executed after the original XReparentWindow, so the client does not end up where it's supposed to be.

REVIEW: 109484
This commit is contained in:
Thomas Lübking 2013-03-05 18:04:30 +01:00
parent 72db0e5e71
commit 9a3a7c8824
2 changed files with 16 additions and 1 deletions

View file

@ -740,7 +740,17 @@ void Client::unmapNotifyEvent(XUnmapEvent* e)
if (ignore) if (ignore)
return; return;
} }
releaseWindow();
// check whether this is result of an XReparentWindow - client then won't be parented by wrapper
// in this case do not release the client (causes reparent to root, removal from saveSet and what not)
// but just destroy the client
Xcb::Tree tree(client);
xcb_window_t daddy = tree.parent();
if (daddy == wrapper) {
releaseWindow(); // unmapped from a regular client state
} else {
destroyClient(); // the client was moved to some other parent
}
} }
void Client::destroyNotifyEvent(XDestroyWindowEvent* e) void Client::destroyNotifyEvent(XDestroyWindowEvent* e)

View file

@ -179,6 +179,11 @@ public:
inline WindowId *children() { inline WindowId *children() {
return xcb_query_tree_children(data()); return xcb_query_tree_children(data());
} }
inline xcb_window_t parent() {
if (isNull())
return XCB_WINDOW_NONE;
return (*this)->parent;
}
}; };
inline xcb_get_input_focus_cookie_t get_input_focus(xcb_connection_t *c, xcb_window_t) { inline xcb_get_input_focus_cookie_t get_input_focus(xcb_connection_t *c, xcb_window_t) {