From b703bbb0b06824aa5febfe13b0d4e04ff2d27716 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20J=C3=B8rgen=20Br=C3=B8nner?= Date: Thu, 17 May 2018 15:35:58 +0200 Subject: [PATCH] Bugfix: fixStack not always called when window receives focus The primary symptom is that the wrong window is focused next when the current window is closed. Most easily triggered by quickly letting go when navigation to the window (from far away). I'm not sure why the fixStack call was conditioned in the first place? Probably regression after: 8d3ae51728efbcd48b4a49a7d7e05f0b34d61f4b --- tiling.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tiling.js b/tiling.js index 8d90652..fbdc31f 100644 --- a/tiling.js +++ b/tiling.js @@ -1189,7 +1189,8 @@ function focus_handler(meta_window, user_data) { } let space = spaces.spaceOfWindow(meta_window); - ensureViewport(meta_window, space) !== undefined && fixStack(space, space.indexOf(meta_window)); + ensureViewport(meta_window, space); + fixStack(space, space.indexOf(meta_window)); } let focus_wrapper = utils.dynamic_function_ref('focus_handler', Me); @@ -1241,6 +1242,7 @@ let showWrapper = utils.dynamic_function_ref('showHandler', Me); stack, not the mru, when auto choosing focus after closing a window. */ function fixStack(space, around) { + utils.debug("stack", "fix stack"); let mru = global.display.get_tab_list(Meta.TabList.NORMAL, space.workspace);