Don't look up workspace_index on _previewWorkspace

fixes #38 Removing workspaces while the multimap is active can cause crashing
This commit is contained in:
Tor Hedin Brønner
2017-10-25 18:50:30 +02:00
parent faf15c1ceb
commit ee4b30f90c
2 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -65,10 +65,10 @@ WindowManager.WindowManager.prototype._previewWorkspace = function(from, to, dir
switchData.movingWindow = record;
switchData.windows.push(switchData.movingWindow);
actor.reparent(switchData.movingWindowBin);
} else if (window.get_workspace().index() == from) {
} else if (window.get_workspace() == from) {
switchData.windows.push(record);
actor.reparent(switchData.outGroup);
} else if (window.get_workspace().index() == to) {
} else if (window.get_workspace() == to) {
switchData.windows.push(record);
actor.reparent(switchData.inGroup);
actor.show();
@@ -164,8 +164,8 @@ LiveAltTab = Lang.Class({
let toIndex = to.get_workspace().workspace_index;
if (toIndex !== fromIndex) {
let direction = fromIndex < toIndex ? Meta.MotionDirection.DOWN : Meta.MotionDirection.UP;
Main.wm._previewWorkspace(from.get_workspace().workspace_index,
to.get_workspace().workspace_index,
Main.wm._previewWorkspace(from.get_workspace(),
to.get_workspace(),
direction)
this.switchedWorkspace = true;
}
+2 -2
View File
@@ -866,8 +866,8 @@ PreviewedWindowNavigator = new Lang.Class({
}
// This will crash gnome-shell if one of the workspaces have been removed
Main.wm._previewWorkspace(oldMap.space.workspace.workspace_index,
newMap.space.workspace.workspace_index,
Main.wm._previewWorkspace(oldMap.space.workspace,
newMap.space.workspace,
direction);
this.space = newMap.space;
this._select(this.space.selectedIndex());