diff --git a/client.c b/client.c index 8be31538..97a37028 100644 --- a/client.c +++ b/client.c @@ -722,9 +722,13 @@ client_updatewmhints(client_t *c) if((wmh = xcb_get_wm_hints(globalconf.connection, c->win))) { + bool isurgent; wm_hints_flags = xcb_wm_hints_get_flags(wmh); - if((c->isurgent = xcb_wm_hints_get_urgency(wmh))) + isurgent = xcb_wm_hints_get_urgency(wmh); + if(isurgent != c->isurgent) { + c->isurgent = isurgent; + /* execute hook */ luaA_client_userdata_new(globalconf.L, c); luaA_dofunction(globalconf.L, globalconf.hooks.urgent, 1, 0); diff --git a/ewmh.c b/ewmh.c index 6a44f0ca..b508f838 100644 --- a/ewmh.c +++ b/ewmh.c @@ -353,13 +353,12 @@ ewmh_process_state_atom(client_t *c, xcb_atom_t state, int set) if(set == _NET_WM_STATE_REMOVE) c->isurgent = false; else if(set == _NET_WM_STATE_ADD) - { c->isurgent = true; - /* execute hook */ - luaA_client_userdata_new(globalconf.L, c); - luaA_dofunction(globalconf.L, globalconf.hooks.urgent, 1, 0); - widget_invalidate_cache(c->screen, WIDGET_CACHE_CLIENTS); - } + + /* execute hook */ + luaA_client_userdata_new(globalconf.L, c); + luaA_dofunction(globalconf.L, globalconf.hooks.urgent, 1, 0); + widget_invalidate_cache(c->screen, WIDGET_CACHE_CLIENTS); } }