From a2c836ff348164facc84fe5af5d08e2b5806f36b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Hedin=20Br=C3=B8nner?= Date: Tue, 3 Oct 2017 01:46:40 +0200 Subject: [PATCH] Don't try to preview worksapces that doesn't exist --- tiling.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tiling.js b/tiling.js index f4e0e85..d515938 100644 --- a/tiling.js +++ b/tiling.js @@ -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);