Skip to content

Commit

Permalink
FIX: for dropping, don't use callbackOnActor delay.
Browse files Browse the repository at this point in the history
  • Loading branch information
jtaala committed Aug 12, 2024
1 parent 57a8c12 commit cf41092
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tiling.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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,
Expand Down Expand Up @@ -4149,7 +4156,7 @@ export function insertWindow(metaWindow, options = {}) {
ensureViewport(space.selectedWindow, space);
space.setSpaceTopbarElementsVisible(true);

slurpCheck();
slurpCheck(true);
});

return;
Expand All @@ -4166,7 +4173,7 @@ export function insertWindow(metaWindow, options = {}) {
}

if (dropping) {
slurpCheck();
slurpCheck(false);
}
}

Expand Down Expand Up @@ -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());
},
});
Expand Down

0 comments on commit cf41092

Please sign in to comment.