From aeebf8daa5a4fc7c88ece667f2a2942e592e4f88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Hedin=20Br=C3=B8nner?= Date: Fri, 6 Jul 2018 23:56:39 +0200 Subject: [PATCH] Connect `size-changed` signal when adding new windows to the scratch Missed a return on `addToScratch`. --- tiling.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tiling.js b/tiling.js index e3ff7f8..d87e83f 100644 --- a/tiling.js +++ b/tiling.js @@ -1120,6 +1120,10 @@ function add_handler(ws, metaWindow) { */ function insertWindow(metaWindow, {existing}) { + let connectSizeChanged = () => { + !existing && signals.connect(metaWindow, 'size-changed', resizeHandler); + }; + if (!existing) { let scratchIsFocused = Scratch.isScratchWindow(global.display.focus_window); let addToScratch = scratchIsFocused; @@ -1136,6 +1140,7 @@ function insertWindow(metaWindow, {existing}) { } if (addToScratch) { + connectSizeChanged(); Scratch.makeScratch(metaWindow); if (scratchIsFocused) { Main.activateWindow(metaWindow); @@ -1145,7 +1150,7 @@ function insertWindow(metaWindow, {existing}) { } if (!add_filter(metaWindow)) { - !existing && signals.connect(metaWindow, 'size-changed', resizeHandler); + connectSizeChanged(); return; } @@ -1186,7 +1191,7 @@ function insertWindow(metaWindow, {existing}) { transition: 'easeInOutQuad', onComplete: () => { space.layout(); - signals.connect(metaWindow, 'size-changed', resizeHandler); + connectSizeChanged(); } }); } else {