From 4671d4c8f87f587edf078a115b832a1c4aa5817d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Hedin=20Br=C3=B8nner?= Date: Sat, 16 Sep 2017 12:02:54 +0200 Subject: [PATCH] Add print debugging for the PreviewNavigator Also use `this._switcherList.windows` instead of calling `_getWindowList` again. (which might fix things, but probably not). --- tiling.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tiling.js b/tiling.js index 7eec06c..31eaabb 100644 --- a/tiling.js +++ b/tiling.js @@ -109,6 +109,7 @@ ensure_viewport = (meta_window, force) => { debug('already ensuring', meta_window.title); return; } + debug('Ensuring', meta_window.title); let workspace = workspaces[meta_window.get_workspace().workspace_index]; let index = workspace.indexOf(meta_window) @@ -533,6 +534,7 @@ PreviewedWindowNavigator = new Lang.Class({ _init : function() { this.parent(); this._selectedIndex = focus(); + debug('#preview', 'Init', this._switcherList.windows[this._selectedIndex].title, this._selectedIndex); }, _initialSelection: function(backward, binding) { @@ -549,7 +551,8 @@ PreviewedWindowNavigator = new Lang.Class({ }, _select: function(index) { - ensure_viewport(this._getWindowList()[index]); + debug('#preview', 'Select', this._switcherList.windows[index].title, index); + ensure_viewport(this._switcherList.windows[index]); this.parent(index); }, @@ -559,8 +562,11 @@ PreviewedWindowNavigator = new Lang.Class({ }, _onDestroy: function() { + // this._selectedIndex is gone here, which might be the problem + debug('#preview', 'onDestroy', this._selecetedIndex) if(!this.was_accepted && this._selectedIndex != focus()) { - ensure_viewport(global.display.focus_window); + debug('#preview', 'Abort', global.display.focus_window.title); + ensure_viewport(global.display.focus_window, true); } this.parent(); }