[gnome-shell-extensions/ws-thumb-fixes: 4/4] workspace-indicator: Use overlap to determine preview visibility




commit 6d2226f5f55ef66d4756571c1c73a23fc600a6e2
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Oct 21 20:43:46 2020 +0200

    workspace-indicator: Use overlap to determine preview visibility

 extensions/workspace-indicator/extension.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/extensions/workspace-indicator/extension.js b/extensions/workspace-indicator/extension.js
index 8e7d297..c051ccf 100644
--- a/extensions/workspace-indicator/extension.js
+++ b/extensions/workspace-indicator/extension.js
@@ -67,8 +67,10 @@ class WindowPreview extends St.Button {
     }
 
     _updateVisible() {
-        let monitor = Main.layoutManager.findIndexForActor(this);
-        this.visible = monitor === this._window.get_monitor() &&
+        const monitor = Main.layoutManager.findIndexForActor(this);
+        const workArea = Main.layoutManager.getWorkAreaForMonitor(monitor);
+        this.visible = this._window.get_frame_rect().overlap(workArea) &&
+
             this._window.window_type !== Meta.WindowType.DESKTOP &&
             this._window.showing_on_its_workspace();
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]