Ensure grab window remains focused when ending navigation before dnd

This commit is contained in:
Ole Jørgen Brønner
2020-12-05 20:36:19 +01:00
committed by Tor Hedin Brønner
parent 73442b9a62
commit de4a31b0ed
2 changed files with 10 additions and 2 deletions
+6 -2
View File
@@ -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) {
+4
View File
@@ -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.