diff --git a/lib/awful/layout/init.lua.in b/lib/awful/layout/init.lua.in index b881b0b4..86b52616 100755 --- a/lib/awful/layout/init.lua.in +++ b/lib/awful/layout/init.lua.in @@ -42,6 +42,8 @@ layout.layouts = { -- This is a special lock used by the arrange function. -- This avoids recurring call by emitted signals. local arrange_lock = false +-- Delay one arrange call per screen. +local delayed_arrange = {} --- Get the current layout. -- @param screen The screen number. @@ -95,10 +97,13 @@ end --- Arrange a screen using its current layout. -- @param screen The screen to arrange. function layout.arrange(screen) - if arrange_lock then return end - arrange_lock = true + if delayed_arrange[screen] then return end + delayed_arrange[screen] = true timer.delayed_call(function() + if arrange_lock then return end + arrange_lock = true + local p = {} p.workarea = capi.screen[screen].workarea -- Handle padding @@ -116,6 +121,7 @@ function layout.arrange(screen) capi.screen[screen]:emit_signal("arrange") arrange_lock = false + delayed_arrange[screen] = nil end) end