From 9fb9b1fd5395eff32d2d6231e1c93c0aafb164e5 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Tue, 6 Oct 2020 10:37:54 -0400
Subject: [PATCH 2/5] panelMenu: Add a destroy handler to panel menu
This prevents some spew from classic mode extensions
---
js/ui/panelMenu.js | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/js/ui/panelMenu.js b/js/ui/panelMenu.js
index b23d8e49f..c44e91f8c 100644
--- a/js/ui/panelMenu.js
+++ b/js/ui/panelMenu.js
@@ -165,61 +165,66 @@ var Button = new Lang.Class({
},
_onOpenStateChanged(menu, open) {
if (open)
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 workArea = Main.layoutManager.getWorkAreaForMonitor(Main.layoutManager.primaryIndex);
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
let verticalMargins = this.menu.actor.margin_top + this.menu.actor.margin_bottom;
// The workarea and margin dimensions are in physical pixels, but CSS
// measures are in logical pixels, so make sure to consider the scale
// factor when computing max-height
let maxHeight = Math.round((workArea.height - verticalMargins) / scaleFactor);
this.menu.actor.style = ('max-height: %spx;').format(maxHeight);
},
destroy() {
this.actor._delegate = null;
if (this.menu)
this.menu.destroy();
this.actor.destroy();
this.emit('destroy');
+ },
+
+ _onDestroy() {
+ /* Just a placeholder for newer extension compatibility */
}
+
});
Signals.addSignalMethods(Button.prototype);
/* SystemIndicator:
*
* This class manages one system indicator, which are the icons
* that you see at the top right. A system indicator is composed
* of an icon and a menu section, which will be composed into the
* aggregate menu.
*/
var SystemIndicator = new Lang.Class({
Name: 'SystemIndicator',
_init() {
this.indicators = new St.BoxLayout({ style_class: 'panel-status-indicators-box',
reactive: true });
this.indicators.hide();
this.menu = new PopupMenu.PopupMenuSection();
},
_syncIndicatorsVisible() {
this.indicators.visible = this.indicators.get_children().some(a => a.visible);
},
_addIndicator() {
let icon = new St.Icon({ style_class: 'system-status-icon' });
this.indicators.add_actor(icon);
icon.connect('notify::visible', this._syncIndicatorsVisible.bind(this));
this._syncIndicatorsVisible();
return icon;
--
2.26.2