gnome-shell-extensions/more-ws-previews-0007-window-list-Handle-changes-to-workspace-menu.patch

45 lines
1.6 KiB
Diff
Raw Normal View History

From dca2c8505c770958849fc8dda27715a09ceab3c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Thu, 21 Mar 2024 16:49:35 +0100
Subject: [PATCH 07/28] window-list: Handle changes to workspace menu
For now the menu is always set at construction time, however this
will change in the future. Prepare for that by handling the
`menu-set` signal, similar to the top bar.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/307>
---
extensions/window-list/extension.js | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js
index 1bb7cf60..3950c535 100644
--- a/extensions/window-list/extension.js
+++ b/extensions/window-list/extension.js
@@ -782,7 +782,9 @@ class WindowList extends St.Widget {
this._updateWorkspaceIndicatorVisibility();
this._menuManager = new PopupMenu.PopupMenuManager(this);
- this._menuManager.addMenu(this._workspaceIndicator.menu);
+ this._workspaceIndicator.connectObject('menu-set',
+ () => this._onWorkspaceMenuSet(), this);
+ this._onWorkspaceMenuSet();
Main.layoutManager.addChrome(this, {
affectsStruts: true,
@@ -879,6 +881,11 @@ class WindowList extends St.Widget {
children[newActive].activate();
}
+ _onWorkspaceMenuSet() {
+ if (this._workspaceIndicator.menu)
+ this._menuManager.addMenu(this._workspaceIndicator.menu);
+ }
+
_updatePosition() {
this.set_position(
this._monitor.x,
--
2.44.0