[gnome-shell] workspacesView: Simplify syncing actual geometry
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] workspacesView: Simplify syncing actual geometry
- Date: Mon, 6 Jul 2020 22:46:14 +0000 (UTC)
commit 51fd0875d186109124894d09b74226162479e06c
Author: Florian Müllner <fmuellner gnome org>
Date: Fri Jun 26 01:15:33 2020 +0200
workspacesView: Simplify syncing actual geometry
We adjust the size and position of the primary view to match the workspaces
display, but views on other monitors are always set to fill their monitor.
Take that into account and create views with a fixed size and position, then
only sync the primary view to the new geometry.
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1345
js/ui/workspacesView.js | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js
index 9335da625f..77661b2877 100644
--- a/js/ui/workspacesView.js
+++ b/js/ui/workspacesView.js
@@ -21,7 +21,13 @@ var WorkspacesViewBase = GObject.registerClass({
GTypeFlags: GObject.TypeFlags.ABSTRACT,
}, class WorkspacesViewBase extends St.Widget {
_init(monitorIndex) {
- super._init({ style_class: 'workspaces-view' });
+ const { x, y, width, height } =
+ Main.layoutManager.monitors[monitorIndex];
+
+ super._init({
+ style_class: 'workspaces-view',
+ x, y, width, height,
+ });
this.connect('destroy', this._onDestroy.bind(this));
global.focus_manager.add_group(this);
@@ -747,16 +753,11 @@ class WorkspacesDisplay extends St.Widget {
}
_syncWorkspacesActualGeometry() {
- if (!this._workspacesViews.length)
+ const primaryView = this._getPrimaryView();
+ if (!primaryView)
return;
- let monitors = Main.layoutManager.monitors;
- for (let i = 0; i < monitors.length; i++) {
- let geometry = i === this._primaryIndex ? this._actualGeometry : monitors[i];
- const { x, y, width, height } = geometry;
-
- this._workspacesViews[i].set({ x, y, width, height });
- }
+ primaryView.set(this._actualGeometry);
}
_onRestacked(overview, stackIndices) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]