From 9c97f01bc23cd7513d309ffd7ead0e130b7b5849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 21 Mar 2024 16:49:35 +0100 Subject: [PATCH] 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: --- 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 cc22e9fe..715ae249 100644 --- a/extensions/window-list/extension.js +++ b/extensions/window-list/extension.js @@ -765,7 +765,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, @@ -862,6 +864,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,