[gnome-shell] workspacesView: Work around Clutter optimization



commit da36506ea5a12fd0a1f24c2da421832918e8951c
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat Oct 3 10:12:13 2020 +0200

    workspacesView: Work around Clutter optimization
    
    Clutter nowadays omits reallocations when only the stage position
    changed, that is when the allocation relative to the parent changed.
    
    As a result (apart from better performance of course), workspaces
    in the overview may now end up with an outdated "actual geometry"
    in case the overview moved to a new primary monitor (of equal size
    as the previous one).
    
    Work around that by emitting a signal from the overview on allocation
    changes, and use that to update the cached geometry.
    
    We can revert that change once workspaces become part of the regular
    overview hierarchy.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3211

 js/ui/overview.js       | 1 +
 js/ui/workspacesView.js | 3 +++
 2 files changed, 4 insertions(+)
---
diff --git a/js/ui/overview.js b/js/ui/overview.js
index 219645dd6a..9682f8e142 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -294,6 +294,7 @@ var Overview = class {
         this._overview = new OverviewActor();
         this._overview._delegate = this;
         Main.layoutManager.overviewGroup.add_child(this._overview);
+        this._overview.connect('notify::allocation', () => this.emit('relayout'));
 
         this._shellInfo = new ShellInfo();
 
diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js
index b97bf5a4c8..4aac1cc1cd 100644
--- a/js/ui/workspacesView.js
+++ b/js/ui/workspacesView.js
@@ -339,6 +339,9 @@ class WorkspacesDisplay extends St.Widget {
         });
         this.connect('notify::allocation', this._updateWorkspacesActualGeometry.bind(this));
 
+        Main.overview.connect('relayout',
+            () => this._updateWorkspacesActualGeometry());
+
         let workspaceManager = global.workspace_manager;
         this._scrollAdjustment = scrollAdjustment;
 


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