awful.tag: Use delayed_call to call withcurrent on manage
This way this function runs after everything else did its job. The client will only get assigned a tag after everything else had a chance to do so. Thanks to this, awful.rules no longer has to disconnect the call to withcurrent. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
7bc4ab0bf7
commit
90fde1393f
|
@ -224,11 +224,6 @@ function rules.execute(c, props, callbacks)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- If untagged, stick the client on the current one.
|
|
||||||
if #c:tags() == 0 then
|
|
||||||
atag.withcurrent(c)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Apply all callbacks.
|
-- Apply all callbacks.
|
||||||
if callbacks then
|
if callbacks then
|
||||||
for i, callback in pairs(callbacks) do
|
for i, callback in pairs(callbacks) do
|
||||||
|
@ -244,7 +239,6 @@ function rules.execute(c, props, callbacks)
|
||||||
end
|
end
|
||||||
|
|
||||||
client.connect_signal("manage", rules.apply)
|
client.connect_signal("manage", rules.apply)
|
||||||
client.disconnect_signal("manage", atag.withcurrent)
|
|
||||||
|
|
||||||
return rules
|
return rules
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
-- Grab environment we need
|
-- Grab environment we need
|
||||||
local util = require("awful.util")
|
local util = require("awful.util")
|
||||||
|
local timer = require("gears.timer")
|
||||||
local tostring = tostring
|
local tostring = tostring
|
||||||
local pairs = pairs
|
local pairs = pairs
|
||||||
local ipairs = ipairs
|
local ipairs = ipairs
|
||||||
|
@ -629,7 +630,9 @@ capi.client.connect_signal("manage", function(c)
|
||||||
c:connect_signal("property::screen", tag.withcurrent)
|
c:connect_signal("property::screen", tag.withcurrent)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
capi.client.connect_signal("manage", tag.withcurrent)
|
capi.client.connect_signal("manage", function(c)
|
||||||
|
timer.delayed_call(tag.withcurrent, c)
|
||||||
|
end)
|
||||||
capi.tag.connect_signal("request::select", tag.viewonly)
|
capi.tag.connect_signal("request::select", tag.viewonly)
|
||||||
|
|
||||||
capi.tag.add_signal("property::hide")
|
capi.tag.add_signal("property::hide")
|
||||||
|
|
Loading…
Reference in New Issue