From e77dd01e5af040c756218fcac348af17347bd268 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Sun, 1 Dec 2019 00:01:05 -0500 Subject: [PATCH] Add more TOVOv5 for unfixable APIs. Another pull request at some point will add proper API levels, it will then become possible to fix these without breaking the API for everybody. However right now there is no way around the problems. --- ewmh.c | 5 +++++ lib/awful/tag.lua | 2 ++ property.c | 1 + 3 files changed, 8 insertions(+) diff --git a/ewmh.c b/ewmh.c index 8a1dfcf1c..ad7f51078 100644 --- a/ewmh.c +++ b/ewmh.c @@ -412,14 +412,17 @@ ewmh_process_state_atom(client_t *c, xcb_atom_t state, int set) { if(set == _NET_WM_STATE_REMOVE) { lua_pushboolean(L, false); + /*TODO v5: Add a context */ luaA_object_emit_signal(L, -2, "request::urgent", 1); } else if(set == _NET_WM_STATE_ADD) { lua_pushboolean(L, true); + /*TODO v5: Add a context */ luaA_object_emit_signal(L, -2, "request::urgent", 1); } else if(set == _NET_WM_STATE_TOGGLE) { lua_pushboolean(L, !c->urgent); + /*TODO v5: Add a context */ luaA_object_emit_signal(L, -2, "request::urgent", 1); } } @@ -436,6 +439,7 @@ ewmh_process_desktop(client_t *c, uint32_t desktop) { luaA_object_push(L, c); lua_pushboolean(L, true); + /*TODO v5: Move the context argument to arg1 */ luaA_object_emit_signal(L, -2, "request::tag", 1); /* Pop the client, arguments are already popped */ lua_pop(L, 1); @@ -444,6 +448,7 @@ ewmh_process_desktop(client_t *c, uint32_t desktop) { luaA_object_push(L, c); luaA_object_push(L, globalconf.tags.tab[idx]); + /*TODO v5: Move the context argument to arg1 */ luaA_object_emit_signal(L, -2, "request::tag", 1); /* Pop the client, arguments are already popped */ lua_pop(L, 1); diff --git a/lib/awful/tag.lua b/lib/awful/tag.lua index 69123a4a9..afbc02dcd 100644 --- a/lib/awful/tag.lua +++ b/lib/awful/tag.lua @@ -1697,6 +1697,7 @@ capi.client.connect_signal("property::screen", function(c) end if #new_tags == 0 then + --TODO v5: Add a context as first param c:emit_signal("request::tag", nil, {reason="screen"}) elseif #new_tags < #tags then c:tags(new_tags) @@ -1785,6 +1786,7 @@ capi.screen.connect_signal("removed", function(s) end -- Give other code yet another change to save clients for _, c in pairs(capi.client.get(s)) do + --TODO v5: Add a context as first param c:emit_signal("request::tag", nil, { reason = "screen-removed" }) end -- Then force all clients left to go somewhere random diff --git a/property.c b/property.c index a585ce915..7dee8eb2a 100644 --- a/property.c +++ b/property.c @@ -199,6 +199,7 @@ property_update_wm_hints(client_t *c, xcb_get_property_cookie_t cookie) luaA_object_push(L, c); + /*TODO v5: Add a context */ lua_pushboolean(L, xcb_icccm_wm_hints_get_urgency(&wmh)); luaA_object_emit_signal(L, -2, "request::urgent", 1);