diff --git a/LayoutSelector.lua b/LayoutSelector.lua index dbfa236..35880d6 100644 --- a/LayoutSelector.lua +++ b/LayoutSelector.lua @@ -166,9 +166,14 @@ local function executeRestore(filePath, layoutName) win:setFrame({x=x, y=y, w=w, h=h}, 0) end end + + -- Establish sequential window targeting intervals + -- Shifts execution past the window manager canvas updates moveAction() - hs.timer.doAfter(0.5, moveAction) - hs.timer.doAfter(1.5, moveAction) + local intervals = isStubborn and {0.2, 0.6, 1.2, 2.2} or {0.3, 1.0} + for _, delay in ipairs(intervals) do + hs.timer.doAfter(delay, moveAction) + end end end end @@ -178,7 +183,7 @@ local function executeRestore(filePath, layoutName) if launchedAny then hs.alert.show("Syncing Apps...", 3) - hs.timer.doAfter(4.5, moveWindows) + hs.timer.doAfter(5.0, moveWindows) -- Bumped to 5s to let heavy frameworks build window handles completely else moveWindows() end