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`).
This commit is contained in:
Tor Hedin Brønner
2018-06-25 16:50:44 +02:00
parent 8c93f10509
commit 9dc591e697
2 changed files with 6 additions and 4 deletions
+4 -2
View File
@@ -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;
}
}
+2 -2
View File
@@ -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);
}