From e25ed3d8a552dfa43991602918246826f43a4c38 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 11 Sep 2008 17:01:52 +0200 Subject: [PATCH] client: execute urgent hook also when removing urgent hint Signed-off-by: Julien Danjou --- client.c | 6 +++++- ewmh.c | 11 +++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/client.c b/client.c index 8be315380..97a370285 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 6a44f0ca8..b508f838b 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); } }