From f4e044b4feba1ca83c2725eee3fceb2a07b1a389 Mon Sep 17 00:00:00 2001 From: Victor Kareh Date: Thu, 13 Mar 2025 18:01:08 -0400 Subject: [PATCH] apps-menu: Scroll application into view when active When an ApplicationMenuItem becomes active, scroll the application scroll box so that it becomes visible. This stopped working when the gnome-shell API changed from getActive()/setActive() to the active GObject property. Closes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/issues/562 Part-of: --- extensions/apps-menu/extension.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js index c89d21d7..c6084418 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js @@ -65,6 +65,8 @@ class ApplicationMenuItem extends PopupMenu.PopupBaseMenuItem { return maybeStartDrag.call(draggable, event); return false; }; + + this.connect('notify::active', this._onActiveChanged.bind(this)); } activate(event) { @@ -76,10 +78,11 @@ class ApplicationMenuItem extends PopupMenu.PopupBaseMenuItem { Main.overview.hide(); } - setActive(active, params) { - if (active) - this._button.scrollToButton(this); - super.setActive(active, params); + _onActiveChanged() { + if (!this.active) + return; + + this._button.scrollToButton(this); } setDragEnabled(enabled) {