diff --git a/navigator.js b/navigator.js index ca7860c..d38da09 100644 --- a/navigator.js +++ b/navigator.js @@ -289,7 +289,11 @@ var Navigator = class Navigator { // again doesn't trigger a switch signal force && Tiling.spaces.animateToSpace(this.space); } else { - this.space.workspace.activate(global.get_current_time()); + if (Tiling.inGrab && Tiling.inGrab.window) { + this.space.workspace.activate_with_focus(Tiling.inGrab.window, global.get_current_time()); + } else { + this.space.workspace.activate(global.get_current_time()); + } } selected = this.space.indexOf(selected) !== -1 ? selected : @@ -299,7 +303,7 @@ var Navigator = class Navigator { if (focus && focus.is_on_all_workspaces()) selected = focus; - if (selected) { + if (selected && !Tiling.inGrab) { let hasFocus = selected && selected.has_focus(); selected.foreach_transient(mw => hasFocus = mw.has_focus() || hasFocus); if (hasFocus) { diff --git a/tiling.js b/tiling.js index d9f0cb0..af2c8d6 100644 --- a/tiling.js +++ b/tiling.js @@ -1625,6 +1625,10 @@ class Spaces extends Map { let toSpace = this.spaceOf(to); let fromSpace = this.spaceOf(from); + if (inGrab && inGrab.window) { + inGrab.window.change_workspace(toSpace.workspace); + } + for (let metaWindow of toSpace.getWindows()) { // Make sure all windows belong to the correct workspace. // Note: The 'switch-workspace' signal (this method) runs before mutter decides on focus window.