From 04da9b05190271bd07b7a6e06b35b7d18ea1a2f2 Mon Sep 17 00:00:00 2001 From: Florian Mounier Date: Tue, 13 Aug 2019 10:47:49 +0200 Subject: [PATCH] Remove windowFocused copy (to avoid desync) --- tilingManager/tilingLayouts/baseTiling.js | 5 +---- tilingManager/tilingLayouts/maximize.js | 6 +++--- tilingManager/tilingLayouts/split.js | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/tilingManager/tilingLayouts/baseTiling.js b/tilingManager/tilingLayouts/baseTiling.js index d370765..0f31842 100644 --- a/tilingManager/tilingLayouts/baseTiling.js +++ b/tilingManager/tilingLayouts/baseTiling.js @@ -12,7 +12,6 @@ var BaseTilingLayout = class BaseTilingLayout { ); this.superWorkspace = superWorkspace; this.monitor = superWorkspace.monitor; - this.windowFocused = this.superWorkspace.windowFocused; this.windowChangedId = this.superWorkspace.connect( 'windows-changed', this.onWindowsChanged.bind(this) @@ -43,9 +42,7 @@ var BaseTilingLayout = class BaseTilingLayout { } } - onFocusChanged(windowFocused) { - this.windowFocused = windowFocused; - } + onFocusChanged() {} onTile() { log(`Tile ${this.superWorkspace.categoryKey}`); diff --git a/tilingManager/tilingLayouts/maximize.js b/tilingManager/tilingLayouts/maximize.js index 089f9fe..4836b35 100644 --- a/tilingManager/tilingLayouts/maximize.js +++ b/tilingManager/tilingLayouts/maximize.js @@ -26,7 +26,6 @@ var MaximizeLayout = class MaximizeLayout extends BaseTilingLayout { const oldIndex = this.superWorkspace.windows.indexOf( oldWindowFocused ); - this.windowFocused = windowFocused; const direction = newIndex > oldIndex ? 1 : -1; this.prepareTransition(windowFocused, oldWindowFocused, direction); this.animateTransition(direction); @@ -39,12 +38,13 @@ var MaximizeLayout = class MaximizeLayout extends BaseTilingLayout { } windows.forEach(window => { if ( - window !== this.windowFocused || + window !== this.superWorkspace.windowFocused || !this.superWorkspace.isDisplayed() ) { window.get_compositor_private().hide(); } else { if (!window.grabbed && !window.maximized_horizontally) { + Main.wm.skipNextEffect(window.get_compositor_private()); window.maximize(Meta.MaximizeFlags.BOTH); } window.get_compositor_private().show(); @@ -55,7 +55,7 @@ var MaximizeLayout = class MaximizeLayout extends BaseTilingLayout { onDestroy() { super.onDestroy(); this.superWorkspace.windows.forEach(window => { - if (window !== this.windowFocused) { + if (window !== this.superWorkspace.windowFocused) { window.get_compositor_private().show(); } }); diff --git a/tilingManager/tilingLayouts/split.js b/tilingManager/tilingLayouts/split.js index bf14fa8..21b6f10 100644 --- a/tilingManager/tilingLayouts/split.js +++ b/tilingManager/tilingLayouts/split.js @@ -27,7 +27,7 @@ var SplitLayout = class SplitLayout extends BaseGrabbableLayout { this.baseIndex = Math.max( 0, Math.min( - regularWindows.indexOf(this.windowFocused), + regularWindows.indexOf(this.superWorkspace.windowFocused), regularWindows.length - WINDOW_PER_SCREEN ) );