From c8b8d78636a6696e9c392be75b136459fe12cd30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Hedin=20Br=C3=B8nner?= Date: Thu, 17 Oct 2019 18:39:13 +0200 Subject: [PATCH] insertWindow: Handle stuck windows minimally When spawning windows on a secondary monitor, and there's workspaces-only-on-primary, we simply want to connect the necessary signals and make sure the window is shown. --- tiling.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tiling.js b/tiling.js index 28e60e1..3d2948e 100644 --- a/tiling.js +++ b/tiling.js @@ -2069,8 +2069,8 @@ function insertWindow(metaWindow, {existing}) { let actor = metaWindow.get_compositor_private(); - let connectSizeChanged = (tiled) => { - if (tiled) + let connectSizeChanged = (show) => { + if (show) animateWindow(metaWindow); actor.opacity = 255; metaWindow.unmapped && signals.connect(metaWindow, 'size-changed', resizeHandler); @@ -2114,8 +2114,13 @@ function insertWindow(metaWindow, {existing}) { } } - if (Scratch.isScratchWindow(metaWindow) && !metaWindow.is_on_all_workspaces()) { - // Moving from secondary monitor to primary can strip `is_on_all_workspaces`. + if (metaWindow.is_on_all_workspaces()) { + // Only connect the necessary signals and show windows on shared + // secondary monitors. + connectSizeChanged(true); + return; + } else if (Scratch.isScratchWindow(metaWindow)){ + // And make sure scratch windows are stuck Scratch.makeScratch(metaWindow); return; }