diff --git a/ewmh.c b/ewmh.c index e2e1ccf3..9d6411b7 100755 --- a/ewmh.c +++ b/ewmh.c @@ -346,12 +346,18 @@ ewmh_process_state_atom(client_t *c, xcb_atom_t state, int set) } else if(state == _NET_WM_STATE_DEMANDS_ATTENTION) { - if(set == _NET_WM_STATE_REMOVE) - client_set_urgent(L, -1, false); - else if(set == _NET_WM_STATE_ADD) - client_set_urgent(L, -1, true); - else if(set == _NET_WM_STATE_TOGGLE) - client_set_urgent(L, -1, !c->urgent); + if(set == _NET_WM_STATE_REMOVE) { + lua_pushboolean(L, false); + luaA_object_emit_signal(L, -2, "request::urgent", 1); + } + else if(set == _NET_WM_STATE_ADD) { + lua_pushboolean(L, true); + luaA_object_emit_signal(L, -2, "request::urgent", 1); + } + else if(set == _NET_WM_STATE_TOGGLE) { + lua_pushboolean(L, !c->urgent); + luaA_object_emit_signal(L, -2, "request::urgent", 1); + } } lua_pop(L, 1); diff --git a/lib/awful/ewmh.lua.in b/lib/awful/ewmh.lua.in index a347995c..d3dd608c 100644 --- a/lib/awful/ewmh.lua.in +++ b/lib/awful/ewmh.lua.in @@ -10,6 +10,7 @@ local screen = screen local ipairs = ipairs local math = math local atag = require("awful.tag") +local aclient = require("awful.client") --- Implements EWMH requests handling. -- awful.ewmh @@ -158,8 +159,15 @@ function ewmh.tag(c, t) end end +function ewmh.urgent(c, urgent) + if c ~= client.focus and not aclient.property.get(c,"ignore_urgent") then + c.urgent = urgent + end +end + client.connect_signal("request::activate", ewmh.activate) client.connect_signal("request::tag", ewmh.tag) +client.connect_signal("request::urgent", ewmh.urgent) client.connect_signal("request::maximized_horizontal", maximized_horizontal) client.connect_signal("request::maximized_vertical", maximized_vertical) client.connect_signal("request::fullscreen", fullscreen) diff --git a/objects/client.c b/objects/client.c old mode 100644 new mode 100755 index 1e2ea4f8..c5ef8798 --- a/objects/client.c +++ b/objects/client.c @@ -2524,6 +2524,7 @@ client_class_setup(lua_State *L) signal_add(&client_class.signals, "request::maximized_horizontal"); signal_add(&client_class.signals, "request::maximized_vertical"); signal_add(&client_class.signals, "request::tag"); + signal_add(&client_class.signals, "request::urgent"); signal_add(&client_class.signals, "tagged"); signal_add(&client_class.signals, "unfocus"); signal_add(&client_class.signals, "unmanage"); diff --git a/property.c b/property.c index c866c317..5fcd8f66 100644 --- a/property.c +++ b/property.c @@ -198,7 +198,9 @@ property_update_wm_hints(client_t *c, xcb_get_property_cookie_t cookie) return; luaA_object_push(L, c); - client_set_urgent(L, -1, xcb_icccm_wm_hints_get_urgency(&wmh)); + + lua_pushboolean(L, xcb_icccm_wm_hints_get_urgency(&wmh)); + luaA_object_emit_signal(L, -2, "request::urgent", 1); if(wmh.flags & XCB_ICCCM_WM_HINT_INPUT) c->nofocus = !wmh.input; diff --git a/property.h b/property.h old mode 100644 new mode 100755