Bugfix: correctly recognize assigned windows as urgent (Thanks jookia)

fixes #1086
This commit is contained in:
Michael Stapelberg
2013-09-24 07:47:36 +02:00
parent 0fbc40ff5f
commit 1a1d421534
5 changed files with 106 additions and 18 deletions

View File

@ -883,24 +883,13 @@ static bool handle_hints(void *data, xcb_connection_t *conn, uint8_t state, xcb_
return false;
}
xcb_icccm_wm_hints_t hints;
bool urgency_hint;
if (reply == NULL)
if (!(reply = xcb_get_property_reply(conn, xcb_icccm_get_wm_hints(conn, window), NULL)))
return false;
if (!xcb_icccm_get_wm_hints_from_reply(&hints, reply))
return false;
/* Update the flag on the client directly */
bool hint_urgent = (xcb_icccm_wm_hints_get_urgency(&hints) != 0);
con_set_urgency(con, hint_urgent);
reply = xcb_get_property_reply(conn, xcb_icccm_get_wm_hints(conn, window), NULL);
window_update_hints(con->window, reply, &urgency_hint);
con_set_urgency(con, urgency_hint);
tree_render();
if (con->window)
window_update_hints(con->window, reply);
else free(reply);
return true;
}