From 17776051ec2d8522a85219eef6027eb75206dc01 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sun, 15 Feb 2015 00:46:38 +0100 Subject: [PATCH] layout.arrange: delay a call per screen This is a followup / fix for 7410646, which did not handle multiple arrange calls to different screens per main lopp. --- lib/awful/layout/init.lua.in | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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