Support scrolling in workspace menu

Resolves: https://issues.redhat.com/browse/RHEL-153023
This commit is contained in:
Florian Müllner 2026-03-03 20:22:48 +01:00
parent 64a651bf4d
commit b764418f14
No known key found for this signature in database
2 changed files with 153 additions and 1 deletions

View File

@ -7,7 +7,7 @@
Name: gnome-shell-extensions
Version: 40.7
Release: 31%{?dist}
Release: 32%{?dist}
Summary: Modify and extend GNOME Shell functionality and behavior
License: GPLv2+
@ -54,6 +54,7 @@ Patch031: 0001-dash-to-panel-Remove-faulty-version-check.patch
Patch032: window-list-attention-indicator.patch
Patch033: 0001-dash-to-panel-Stop-messing-with-overview-allocation.patch
Patch034: improve-workspace-names.patch
Patch035: scrollable-workspace-menu.patch
%description
GNOME Shell Extensions is a collection of extensions providing additional and
@ -473,6 +474,10 @@ workspaces.
%changelog
* Tue Mar 03 2026 Florian Müllner <fmuellner@redhat.com> - 40.7-32
- Support scrolling in workspace menu
Resolves: RHEL-153023
* Tue Nov 18 2025 Florian Müllner <fmuellner@redhat.com> - 40.7-31
- Fix workspace indicator cleanups
Resolves: RHEL-129395

View File

@ -0,0 +1,147 @@
From 005d74cc09a1ab616a370af19377b615631f5621 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Tue, 3 Mar 2026 12:48:13 +0100
Subject: [PATCH 1/3] workspace-indicator: Use section box to iterate items
Menu items are added to a menu's box, so it is more correct to
use that to access items, even when for menu sections the box
is also used as the menu's actor.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/445>
---
extensions/workspace-indicator/workspaceIndicator.js | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/extensions/workspace-indicator/workspaceIndicator.js b/extensions/workspace-indicator/workspaceIndicator.js
index 43315280..069d4fca 100644
--- a/extensions/workspace-indicator/workspaceIndicator.js
+++ b/extensions/workspace-indicator/workspaceIndicator.js
@@ -564,7 +564,7 @@ class WorkspacesMenu extends PopupMenu.PopupMenu {
const {workspaceManager} = global;
const {nWorkspaces} = workspaceManager;
- const section = this._workspacesSection.actor;
+ const section = this._workspacesSection.box;
while (section.get_n_children() < nWorkspaces) {
const item = new EditableMenuItem();
item.connect('activate', (o, event) => {
@@ -589,7 +589,7 @@ class WorkspacesMenu extends PopupMenu.PopupMenu {
}
_updateWorkspaceLabels() {
- const items = [...this._workspacesSection.actor];
+ const items = [...this._workspacesSection.box];
items.forEach(
(item, i) => (item.label.text = Meta.prefs_get_workspace_name(i)));
}
@@ -598,7 +598,7 @@ class WorkspacesMenu extends PopupMenu.PopupMenu {
const {workspaceManager} = global;
const active = workspaceManager.get_active_workspace_index();
- const items = [...this._workspacesSection.actor];
+ const items = [...this._workspacesSection.box];
items.forEach((item, i) => {
item.setOrnament(i === active
? PopupMenu.Ornament.CHECK
--
2.53.0
From 60151f3feae952b796b51d527f6b69fc7e5db38a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Mon, 2 Mar 2026 18:49:16 +0100
Subject: [PATCH 2/3] workspace-indicator: Support scrolling in workspace menu
While we should always have enough screen estate to fit a reasonable
number of workspaces, the number can go up to 36 where we are pretty
much guaranteed to run out of space.
Support those less common cases by making the workspace list scrollable.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/445>
---
.../workspace-indicator/workspaceIndicator.js | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/extensions/workspace-indicator/workspaceIndicator.js b/extensions/workspace-indicator/workspaceIndicator.js
index 069d4fca..b558bcbd 100644
--- a/extensions/workspace-indicator/workspaceIndicator.js
+++ b/extensions/workspace-indicator/workspaceIndicator.js
@@ -16,6 +16,7 @@ const DND = imports.ui.dnd;
const Main = imports.ui.main;
const PanelMenu = imports.ui.panelMenu;
const PopupMenu = imports.ui.popupMenu;
+const {ensureActorVisibleInScrollView} = imports.misc.util;
const TOOLTIP_OFFSET = 6;
const TOOLTIP_ANIMATION_TIME = 150;
@@ -530,6 +531,16 @@ class WorkspacesMenu extends PopupMenu.PopupMenu {
this.actor.connect('destroy', () => this._onDestroy());
this._workspacesSection = new PopupMenu.PopupMenuSection();
+
+ // make the section scrollable to avoid growing indefinitely
+ const scrollView = new St.ScrollView({
+ style_class: 'vfade',
+ hscrollbar_policy: St.PolicyType.NEVER,
+ });
+ scrollView.add_actor(this._workspacesSection.box);
+ scrollView._delegate = this._workspacesSection;
+ this._workspacesSection.actor = scrollView;
+
this.addMenuItem(this._workspacesSection);
this.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
@@ -579,6 +590,11 @@ class WorkspacesMenu extends PopupMenu.PopupMenu {
this._desktopSettings.set_strv('workspace-names',
[...newNames, ...oldNames.slice(nLabels)]);
});
+ item.connect('notify::active', () => {
+ const view = this._workspacesSection.actor;
+ if (item.active)
+ ensureActorVisibleInScrollView(view, item);
+ });
this._workspacesSection.addMenuItem(item);
}
--
2.53.0
From dac05ddafe3dff480299a724a12b68b19862d651 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Wed, 18 Mar 2026 14:04:34 +0100
Subject: [PATCH 3/3] window-list: Fix flipping menu arrow
The `updateArrowSide()` method changes the effective arrow side,
but not the "user arrow side" that tracks the explicitly requested
side.
This breaks scrolling the workspaces menu, because when checking
whether the menu needs flipping due to size constraints, it does
not fit on either side and boxpointer reverts to the originally
requested side.
This is a shell issue[0], but we can work around it to fix the
immediate issue without a shell update.
[0] https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/4120
---
extensions/window-list/extension.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js
index f0d7564f..76193b8c 100644
--- a/extensions/window-list/extension.js
+++ b/extensions/window-list/extension.js
@@ -1538,6 +1538,7 @@ class BottomWorkspaceIndicator extends WorkspaceIndicator {
return;
this.menu.actor.updateArrowSide(St.Side.BOTTOM);
+ this.menu.actor._userArrowSide = St.Side.BOTTOM;
this.menu.actor.remove_style_class_name('panel-menu');
}
});
--
2.53.0