From 2aa1f84b330809fe26622ce91b4d45592f25fa58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20J=C3=B8rgen=20Br=C3=B8nner?= Date: Thu, 17 May 2018 22:59:47 +0200 Subject: [PATCH] Bugfix: Canceling navigator didn't return to focused window Regression after a8efb66aa52184af5b5272466ac484c208abc614 --- navigator.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/navigator.js b/navigator.js index a359a62..404f23c 100644 --- a/navigator.js +++ b/navigator.js @@ -367,13 +367,20 @@ var PreviewedWindowNavigator = new Lang.Class({ } if (this.space === from && force) { - // We can't activate an already active workspace + // Animate the selected space into full view - normally this + // happens on workspace switch, but activating the same workspace + // again doesn't trigger a switch signal switchWorkspace(this.space.workspace); } let selected = this.space.selectedWindow; if (selected && !Scratch.isScratchActive()) { - Main.activateWindow(selected); + if (selected !== global.display.focus_window) { + Main.activateWindow(selected); + } else { + // Typically on cancel - just make sure the window is in view + Tiling.ensureViewport(selected, this.space); + } debug('#preview', 'Finish', selected.title, this._selectedIndex); } else { this.space.workspace.activate(global.get_current_time());