From 29ba8ab03c16fc9359e3c6c765d67a6d5c4bf718 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 19 Jan 2024 14:01:27 +0100 Subject: [PATCH] panel: Use connectObject() for overview signals We expect top bar and activities button to be around for the entire duration of the session, but some extra caution doesn't hurt. Part-of: --- js/ui/panel.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/js/ui/panel.js b/js/ui/panel.js index 7318e95f0..0309aa1a4 100644 --- a/js/ui/panel.js +++ b/js/ui/panel.js @@ -427,12 +427,12 @@ class ActivitiesButton extends PanelMenu.Button { this.add_child(new WorkspaceIndicators()); - Main.overview.connect('showing', () => { - this.add_style_pseudo_class('checked'); - }); - Main.overview.connect('hiding', () => { - this.remove_style_pseudo_class('checked'); - }); + Main.overview.connectObject('showing', + () => this.add_style_pseudo_class('checked'), + this); + Main.overview.connectObject('hiding', + () => this.remove_style_pseudo_class('checked'), + this); this._xdndTimeOut = 0; } @@ -668,12 +668,12 @@ class Panel extends St.Widget { this.connect('button-press-event', this._onButtonPress.bind(this)); this.connect('touch-event', this._onTouchEvent.bind(this)); - Main.overview.connect('showing', () => { - this.add_style_pseudo_class('overview'); - }); - Main.overview.connect('hiding', () => { - this.remove_style_pseudo_class('overview'); - }); + Main.overview.connectObject('showing', + () => this.add_style_pseudo_class('overview'), + this); + Main.overview.connect('hiding', + () => this.remove_style_pseudo_class('overview'), + this); Main.layoutManager.panelBox.add_child(this); Main.ctrlAltTabManager.addGroup(this,