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:
Daniel Hahler 2015-02-12 23:09:27 +01:00
parent ffa0001d34
commit 74106462ac
1 changed files with 21 additions and 16 deletions

View File

@ -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,6 +97,8 @@ 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
timer.delayed_call(function()
local p = {} local p = {}
p.workarea = capi.screen[screen].workarea p.workarea = capi.screen[screen].workarea
-- Handle padding -- Handle padding
@ -111,7 +114,9 @@ function layout.arrange(screen)
p.screen = screen p.screen = screen
layout.get(screen).arrange(p) layout.get(screen).arrange(p)
capi.screen[screen]:emit_signal("arrange") capi.screen[screen]:emit_signal("arrange")
arrange_lock = false arrange_lock = false
end)
end end
--- Get the current layout name. --- Get the current layout name.