From ff92d962f338d3376dee587f24127118caa7c886 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Tue, 28 Feb 2012 19:09:56 +0100 Subject: [PATCH] PanelMenuButton: set max-width every time the menu is opened Previously, PanelMenuButton would only set max width if the user explicitly clicked the menu button, resulting in submenus without scrollbars if opened via keyboard navigation or mouse over. https://bugzilla.gnome.org/show_bug.cgi?id=658946 --- js/ui/panelMenu.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/js/ui/panelMenu.js b/js/ui/panelMenu.js index 6f15d2a9a..0b71c7c8d 100644 --- a/js/ui/panelMenu.js +++ b/js/ui/panelMenu.js @@ -147,15 +147,6 @@ const Button = new Lang.Class({ if (!this.menu) return; - if (!this.menu.isOpen) { - // Setting the max-height won't do any good if the minimum height of the - // menu is higher then the screen; it's useful if part of the menu is - // scrollable so the minimum height is smaller than the natural height - let monitor = Main.layoutManager.primaryMonitor; - this.menu.actor.style = ('max-height: ' + - Math.round(monitor.height - Main.panel.actor.height) + - 'px;'); - } this.menu.toggle(); }, @@ -198,6 +189,14 @@ const Button = new Lang.Class({ this.actor.add_style_pseudo_class('active'); else this.actor.remove_style_pseudo_class('active'); + + // Setting the max-height won't do any good if the minimum height of the + // menu is higher then the screen; it's useful if part of the menu is + // scrollable so the minimum height is smaller than the natural height + let monitor = Main.layoutManager.primaryMonitor; + this.menu.actor.style = ('max-height: ' + + Math.round(monitor.height - Main.panel.actor.height) + + 'px;'); }, destroy: function() {