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.
This commit is contained in:
parent
72659a5ebb
commit
17776051ec
|
@ -42,6 +42,8 @@ layout.layouts = {
|
||||||
-- This is a special lock used by the arrange function.
|
-- This is a special lock used by the arrange function.
|
||||||
-- This avoids recurring call by emitted signals.
|
-- This avoids recurring call by emitted signals.
|
||||||
local arrange_lock = false
|
local arrange_lock = false
|
||||||
|
-- Delay one arrange call per screen.
|
||||||
|
local delayed_arrange = {}
|
||||||
|
|
||||||
--- Get the current layout.
|
--- Get the current layout.
|
||||||
-- @param screen The screen number.
|
-- @param screen The screen number.
|
||||||
|
@ -95,10 +97,13 @@ end
|
||||||
--- Arrange a screen using its current layout.
|
--- Arrange a screen using its current layout.
|
||||||
-- @param screen The screen to arrange.
|
-- @param screen The screen to arrange.
|
||||||
function layout.arrange(screen)
|
function layout.arrange(screen)
|
||||||
if arrange_lock then return end
|
if delayed_arrange[screen] then return end
|
||||||
arrange_lock = true
|
delayed_arrange[screen] = true
|
||||||
|
|
||||||
timer.delayed_call(function()
|
timer.delayed_call(function()
|
||||||
|
if arrange_lock then return end
|
||||||
|
arrange_lock = true
|
||||||
|
|
||||||
local p = {}
|
local p = {}
|
||||||
p.workarea = capi.screen[screen].workarea
|
p.workarea = capi.screen[screen].workarea
|
||||||
-- Handle padding
|
-- Handle padding
|
||||||
|
@ -116,6 +121,7 @@ function layout.arrange(screen)
|
||||||
capi.screen[screen]:emit_signal("arrange")
|
capi.screen[screen]:emit_signal("arrange")
|
||||||
|
|
||||||
arrange_lock = false
|
arrange_lock = false
|
||||||
|
delayed_arrange[screen] = nil
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue