client: execute urgent hook also when removing urgent hint

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-09-11 17:01:52 +02:00
parent 2da065329b
commit e25ed3d8a5
2 changed files with 10 additions and 7 deletions

View File

@ -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);

11
ewmh.c
View File

@ -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);
}
}