diff --git a/ewmh.c b/ewmh.c index 183b259a..5f9c5b58 100755 --- a/ewmh.c +++ b/ewmh.c @@ -399,7 +399,7 @@ ewmh_process_desktop(client_t *c, uint32_t desktop) if(desktop == 0xffffffff) { luaA_object_push(L, c); - lua_pushnil(L); + lua_pushboolean(L, true); 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/ewmh.lua b/lib/awful/ewmh.lua index de4af306..e110a450 100644 --- a/lib/awful/ewmh.lua +++ b/lib/awful/ewmh.lua @@ -177,8 +177,14 @@ end -- -- @client c A client to tag -- @tag[opt] t A tag to use. If omitted, then the client is made sticky. -function ewmh.tag(c, t) +-- @tparam[opt={}] table hints Extra information +function ewmh.tag(c, t, hints) --luacheck: no unused + -- There is nothing to do + if not t and #c:tags() > 0 then return end + if not t then + c:to_selected_tags() + elseif type(t) == "boolean" and t then c.sticky = true else c.screen = t.screen diff --git a/lib/awful/tag.lua b/lib/awful/tag.lua index a78a1023..7f8ad139 100644 --- a/lib/awful/tag.lua +++ b/lib/awful/tag.lua @@ -29,10 +29,6 @@ local function get_screen(s) return s and capi.screen[s] end --- awful.client is required() at the end of this file so the miss_handler is set --- before it is being required. -local client - local tag = {object = {}, mt = {} } -- Private data @@ -1370,11 +1366,6 @@ object.properties(capi.tag, { setter_fallback = tag.setproperty, }) --- fix a load loop -client = require("awful.client") -capi.client.connect_signal("manage", function(c) client.object.to_selected_tags(c) end) - - return setmetatable(tag, tag.mt) -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/tests/examples/shims/client.lua b/tests/examples/shims/client.lua index f2dd0d38..97d19fd9 100644 --- a/tests/examples/shims/client.lua +++ b/tests/examples/shims/client.lua @@ -12,6 +12,7 @@ local function add_signals(c) c:add_signal("property::screen") c:add_signal("property::geometry") c:add_signal("request::geometry") + c:add_signal("request::tag") c:add_signal("swapped") c:add_signal("raised") c:add_signal("property::_label") --Used internally