Do layout.arrange only once per main loop
This uses timer.delayed_call to arrange the layouts only once per main loop.
This commit is contained in:
parent
ffa0001d34
commit
74106462ac
|
@ -16,6 +16,7 @@ local capi = {
|
||||||
client = client
|
client = client
|
||||||
}
|
}
|
||||||
local client = require("awful.client")
|
local client = require("awful.client")
|
||||||
|
local timer = require("gears.timer")
|
||||||
|
|
||||||
--- Layout module for awful
|
--- Layout module for awful
|
||||||
-- awful.layout
|
-- awful.layout
|
||||||
|
@ -96,22 +97,26 @@ end
|
||||||
function layout.arrange(screen)
|
function layout.arrange(screen)
|
||||||
if arrange_lock then return end
|
if arrange_lock then return end
|
||||||
arrange_lock = true
|
arrange_lock = true
|
||||||
local p = {}
|
|
||||||
p.workarea = capi.screen[screen].workarea
|
timer.delayed_call(function()
|
||||||
-- Handle padding
|
local p = {}
|
||||||
local padding = ascreen.padding(capi.screen[screen])
|
p.workarea = capi.screen[screen].workarea
|
||||||
if padding then
|
-- Handle padding
|
||||||
p.workarea.x = p.workarea.x + (padding.left or 0)
|
local padding = ascreen.padding(capi.screen[screen])
|
||||||
p.workarea.y = p.workarea.y + (padding.top or 0)
|
if padding then
|
||||||
p.workarea.width = p.workarea.width - ((padding.left or 0 ) + (padding.right or 0))
|
p.workarea.x = p.workarea.x + (padding.left or 0)
|
||||||
p.workarea.height = p.workarea.height - ((padding.top or 0) + (padding.bottom or 0))
|
p.workarea.y = p.workarea.y + (padding.top or 0)
|
||||||
end
|
p.workarea.width = p.workarea.width - ((padding.left or 0 ) + (padding.right or 0))
|
||||||
p.geometry = capi.screen[screen].geometry
|
p.workarea.height = p.workarea.height - ((padding.top or 0) + (padding.bottom or 0))
|
||||||
p.clients = client.tiled(screen)
|
end
|
||||||
p.screen = screen
|
p.geometry = capi.screen[screen].geometry
|
||||||
layout.get(screen).arrange(p)
|
p.clients = client.tiled(screen)
|
||||||
capi.screen[screen]:emit_signal("arrange")
|
p.screen = screen
|
||||||
arrange_lock = false
|
layout.get(screen).arrange(p)
|
||||||
|
capi.screen[screen]:emit_signal("arrange")
|
||||||
|
|
||||||
|
arrange_lock = false
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Get the current layout name.
|
--- Get the current layout name.
|
||||||
|
|
Loading…
Reference in New Issue