Bugfix: set WM_STATE to WITHDRAWN when an app unmaps their window(s) (+test)

Fixes: #362
This commit is contained in:
Michael Stapelberg
2011-05-13 17:03:52 +02:00
parent 62e977102b
commit 836a3ad615
2 changed files with 46 additions and 2 deletions

View File

@ -139,8 +139,11 @@ bool tree_close(Con *con, bool kill_window, bool dont_kill_parent) {
} else {
/* un-parent the window */
xcb_reparent_window(conn, con->window->id, root, 0, 0);
/* TODO: client_unmap to set state to withdrawn */
/* We are no longer handling this window, thus set WM_STATE to
* WM_STATE_WITHDRAWN (see ICCCM 4.1.3.1) */
long data[] = { XCB_ICCCM_WM_STATE_WITHDRAWN, XCB_NONE };
xcb_change_property(conn, XCB_PROP_MODE_REPLACE, con->window->id,
A_WM_STATE, A_WM_STATE, 32, 2, data);
}
FREE(con->window->class_class);
FREE(con->window->class_instance);