Add new request::urgent signal
This fix two things: (1) Clients asking to be urgent while focussed, this have been reported a few time for urxvt and I usually link a patch that fix this. This may not be considered a bug by some, but I think it is. (2) Add the ability to stop noisy clients from setting the urgent state themselves.
This commit is contained in:
parent
3ab3bb900a
commit
d688ebe6cd
18
ewmh.c
18
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)
|
else if(state == _NET_WM_STATE_DEMANDS_ATTENTION)
|
||||||
{
|
{
|
||||||
if(set == _NET_WM_STATE_REMOVE)
|
if(set == _NET_WM_STATE_REMOVE) {
|
||||||
client_set_urgent(L, -1, false);
|
lua_pushboolean(L, false);
|
||||||
else if(set == _NET_WM_STATE_ADD)
|
luaA_object_emit_signal(L, -2, "request::urgent", 1);
|
||||||
client_set_urgent(L, -1, true);
|
}
|
||||||
else if(set == _NET_WM_STATE_TOGGLE)
|
else if(set == _NET_WM_STATE_ADD) {
|
||||||
client_set_urgent(L, -1, !c->urgent);
|
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);
|
lua_pop(L, 1);
|
||||||
|
|
|
@ -10,6 +10,7 @@ local screen = screen
|
||||||
local ipairs = ipairs
|
local ipairs = ipairs
|
||||||
local math = math
|
local math = math
|
||||||
local atag = require("awful.tag")
|
local atag = require("awful.tag")
|
||||||
|
local aclient = require("awful.client")
|
||||||
|
|
||||||
--- Implements EWMH requests handling.
|
--- Implements EWMH requests handling.
|
||||||
-- awful.ewmh
|
-- awful.ewmh
|
||||||
|
@ -158,8 +159,15 @@ function ewmh.tag(c, t)
|
||||||
end
|
end
|
||||||
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::activate", ewmh.activate)
|
||||||
client.connect_signal("request::tag", ewmh.tag)
|
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_horizontal", maximized_horizontal)
|
||||||
client.connect_signal("request::maximized_vertical", maximized_vertical)
|
client.connect_signal("request::maximized_vertical", maximized_vertical)
|
||||||
client.connect_signal("request::fullscreen", fullscreen)
|
client.connect_signal("request::fullscreen", fullscreen)
|
||||||
|
|
|
@ -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_horizontal");
|
||||||
signal_add(&client_class.signals, "request::maximized_vertical");
|
signal_add(&client_class.signals, "request::maximized_vertical");
|
||||||
signal_add(&client_class.signals, "request::tag");
|
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, "tagged");
|
||||||
signal_add(&client_class.signals, "unfocus");
|
signal_add(&client_class.signals, "unfocus");
|
||||||
signal_add(&client_class.signals, "unmanage");
|
signal_add(&client_class.signals, "unmanage");
|
||||||
|
|
|
@ -198,7 +198,9 @@ property_update_wm_hints(client_t *c, xcb_get_property_cookie_t cookie)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
luaA_object_push(L, c);
|
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)
|
if(wmh.flags & XCB_ICCCM_WM_HINT_INPUT)
|
||||||
c->nofocus = !wmh.input;
|
c->nofocus = !wmh.input;
|
||||||
|
|
Loading…
Reference in New Issue