From cf41092561a8b4be5375ff2413404b086a628963 Mon Sep 17 00:00:00 2001 From: Jay Ta'ala Date: Mon, 12 Aug 2024 23:36:44 +1000 Subject: [PATCH] FIX: for dropping, don't use callbackOnActor delay. --- tiling.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tiling.js b/tiling.js index 86b5c9f1..27856500 100644 --- a/tiling.js +++ b/tiling.js @@ -4100,7 +4100,7 @@ export function insertWindow(metaWindow, options = {}) { // run a simple layout in pre-prepare layout space.layout(false); - const slurpCheck = () => { + const slurpCheck = timeout => { let slurpPosition; switch (Settings.prefs.open_window_position) { case Settings.OpenWindowPositions.DOWN: @@ -4116,6 +4116,13 @@ export function insertWindow(metaWindow, options = {}) { return; } + // has slurpPosition but no timeout + if (!timeout) { + slurp(active, slurpPosition); + dropCallback(metaWindow); + return; + } + // if need to slurp (i.e. vertical stack) stackSlurpTimeout = GLib.timeout_add( GLib.PRIORITY_DEFAULT, @@ -4149,7 +4156,7 @@ export function insertWindow(metaWindow, options = {}) { ensureViewport(space.selectedWindow, space); space.setSpaceTopbarElementsVisible(true); - slurpCheck(); + slurpCheck(true); }); return; @@ -4166,7 +4173,7 @@ export function insertWindow(metaWindow, options = {}) { } if (dropping) { - slurpCheck(); + slurpCheck(false); } } @@ -5426,7 +5433,6 @@ export function takeWindow(metaWindow, space, options = {}) { existing: true, dropping: true, dropCallback: mw => { - console.log(`deleting window ${mw.title}`); mw.delete(global.get_current_time()); }, });