From 633af3a0df986184227feee1bf39b00c9ee63d64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Hedin=20Br=C3=B8nner?= Date: Sun, 11 Mar 2018 20:07:45 +0100 Subject: [PATCH] Run scratch layer heuristic for all windows on startup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since `add_filter` will filter out «stuck» windows the heuristic wasn't run on any possible scratch windows (since most floating scratch windows are «stuck»). --- tiling.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tiling.js b/tiling.js index 76bd576..a0adf7e 100644 --- a/tiling.js +++ b/tiling.js @@ -825,13 +825,12 @@ function add_all_from_workspace(workspace) { let space = spaces.spaceOf(workspace); windows.forEach((meta_window, i) => { meta_window[focus_signal] = meta_window.connect("focus", focus_wrapper); + if (meta_window.above || meta_window.minimized) { + // Rough heuristic to figure out if a window should float + Scratch.makeScratch(meta_window); + return; + } if(space.indexOf(meta_window) < 0 && add_filter(meta_window, true)) { - if (meta_window.above || meta_window.minimized) { - // Rough heuristic to figure out if a window should float - Scratch.makeScratch(meta_window); - return; - } - // Using add_handler is unreliable since it interacts with focus. space.push(meta_window); }