X-Git-Url: https://git.sur5r.net/?p=i3%2Fi3;a=blobdiff_plain;f=src%2Fhandlers.c;h=00adc0e5ed62dd6a4f768c940835077169cc39b7;hp=b78089db1eef3d3b6479476d6ceb9652c53a2697;hb=fd8e1c98c91c86300904ae85dd22657dcb291bf5;hpb=f32cc6f4ae3f92c63d2f738b69d84269be8549ab diff --git a/src/handlers.c b/src/handlers.c index b78089db..00adc0e5 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -819,18 +819,16 @@ static bool handle_hints(void *data, xcb_connection_t *conn, uint8_t state, xcb_ xcb_icccm_wm_hints_t hints; - if (reply != NULL) { - if (!xcb_icccm_get_wm_hints_from_reply(&hints, reply)) + if (reply == NULL) + if (!(reply = xcb_get_property_reply(conn, xcb_icccm_get_wm_hints(conn, window), NULL))) return false; - } else { - if (!xcb_icccm_get_wm_hints_reply(conn, xcb_icccm_get_wm_hints_unchecked(conn, con->window->id), &hints, NULL)) - return false; - } + + if (!xcb_icccm_get_wm_hints_from_reply(&hints, reply)) + return false; if (!con->urgent && focused == con) { DLOG("Ignoring urgency flag for current client\n"); - FREE(reply); - return true; + goto end; } /* Update the flag on the client directly */ @@ -846,7 +844,10 @@ static bool handle_hints(void *data, xcb_connection_t *conn, uint8_t state, xcb_ tree_render(); - FREE(reply); +end: + if (con->window) + window_update_hints(con->window, reply); + else free(reply); return true; }