Don't try to preview worksapces that doesn't exist

This commit is contained in:
Tor Hedin Brønner
2017-10-03 01:46:40 +02:00
parent 3f8d78d605
commit a2c836ff34
+4
View File
@@ -721,6 +721,8 @@ PreviewedWindowNavigator = new Lang.Class({
let multimap = this._switcherList.actor;
let from = multimap.selectedIndex;
let to = from - 1;
if (to < 0)
return;
Main.wm._previewWorkspaceDone();
Main.wm._previewWorkspace(from, to, Meta.MotionDirection.UP);
multimap.setSelected(to);
@@ -733,6 +735,8 @@ PreviewedWindowNavigator = new Lang.Class({
let multimap = this._switcherList.actor;
let from = multimap.selectedIndex;
let to = from + 1;
if (to >= spaces.length)
return;
Main.wm._previewWorkspaceDone();
Main.wm._previewWorkspace(from, to, Meta.MotionDirection.DOWN);
multimap.setSelected(to);