Handle WM_CHANGE_STATE requests for iconic state

http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.4

 > IconicState - The client's top-level window is iconic (whatever that
 > means for this window manager). The client can assume that its
 > top-level window is not viewable, its icon_window (if any) will be
 > viewable and, failing that, its icon_pixmap (if any) or its
 > WM_ICON_NAME will be displayed.

For these requests, we just close the window.

fixes #1279
This commit is contained in:
Tony Crisci
2014-06-18 04:23:00 -04:00
committed by Michael Stapelberg
parent ca5137eeba
commit 136b3e345b
3 changed files with 65 additions and 0 deletions

View File

@ -791,6 +791,21 @@ static void handle_client_message(xcb_client_message_event_t *event) {
XCB_ATOM_CARDINAL, 32, 4,
&r);
xcb_flush(conn);
} else if (event->type == A_WM_CHANGE_STATE) {
/* http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.4 */
Con *con = con_by_window_id(event->window);
if (con && event->data.data32[0] == 3) {
/* this request is so we can play some animiation showing the
* window physically moving to the tray before we close it (I
* think) */
DLOG("Client has requested iconic state. Closing this con. (con = %p)\n", con);
tree_close(con, DONT_KILL_WINDOW, false, false);
tree_render();
} else {
DLOG("Not handling WM_CHANGE_STATE request. (window = %d, state = %d)\n", event->window, event->data.data32[0]);
}
} else {
DLOG("unhandled clientmessage\n");
return;