From 9dc591e697077f814e2659d02c849b4e8adc115b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Hedin=20Br=C3=B8nner?= Date: Mon, 25 Jun 2018 15:26:17 +0200 Subject: [PATCH] Fix slurp and barf when navigating Simply rebuild all the clones whenever we execute a non-navigating action. This is a bit ad-hoc and the whole minimap should probably be rewritten using signals emitted when the associated space changes (eg. on `space.addWindow`). --- navigator.js | 6 ++++-- tiling.js | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/navigator.js b/navigator.js index 1e5a16b..3ab473b 100644 --- a/navigator.js +++ b/navigator.js @@ -386,9 +386,11 @@ var PreviewedWindowNavigator = new Lang.Class({ && action.name !== 'toggle-scratch') { let metaWindow = this.windows[this._selectedIndex]; action.handler(null, null, metaWindow); + this.windows = this.space.getWindows(); + this._selectedIndex = this.windows.indexOf(this.space.selectedWindow); let minimap = this.minimap; - minimap.layout(false); - this.minimap.select(this._selectedIndex); + minimap.show(); + minimap.select(); return true; } } diff --git a/tiling.js b/tiling.js index 97ad764..3eca0b6 100644 --- a/tiling.js +++ b/tiling.js @@ -1487,7 +1487,7 @@ function slurp(metaWindow) { space.removeWindow(rightNeigbour); let column = space[index]; space.addWindow(rightNeigbour, index, column.length); - ensureViewport(global.display.focus_window, spaces.spaceOfWindow(global.display.focus_window), true); + ensureViewport(space.selectedWindow, space, true); } function barf(metaWindow) { @@ -1503,5 +1503,5 @@ function barf(metaWindow) { let bottom = column[column.length - 1]; space.removeWindow(bottom); space.addWindow(bottom, index + 1); - ensureViewport(global.display.focus_window, spaces.spaceOfWindow(global.display.focus_window), true); + ensureViewport(space.selectedWindow, space, true); }