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: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3126>
This commit is contained in:
Florian Müllner 2024-01-19 14:01:27 +01:00 committed by Marge Bot
parent 10f7344336
commit 29ba8ab03c

View File

@ -427,12 +427,12 @@ class ActivitiesButton extends PanelMenu.Button {
this.add_child(new WorkspaceIndicators()); this.add_child(new WorkspaceIndicators());
Main.overview.connect('showing', () => { Main.overview.connectObject('showing',
this.add_style_pseudo_class('checked'); () => this.add_style_pseudo_class('checked'),
}); this);
Main.overview.connect('hiding', () => { Main.overview.connectObject('hiding',
this.remove_style_pseudo_class('checked'); () => this.remove_style_pseudo_class('checked'),
}); this);
this._xdndTimeOut = 0; this._xdndTimeOut = 0;
} }
@ -668,12 +668,12 @@ class Panel extends St.Widget {
this.connect('button-press-event', this._onButtonPress.bind(this)); this.connect('button-press-event', this._onButtonPress.bind(this));
this.connect('touch-event', this._onTouchEvent.bind(this)); this.connect('touch-event', this._onTouchEvent.bind(this));
Main.overview.connect('showing', () => { Main.overview.connectObject('showing',
this.add_style_pseudo_class('overview'); () => this.add_style_pseudo_class('overview'),
}); this);
Main.overview.connect('hiding', () => { Main.overview.connect('hiding',
this.remove_style_pseudo_class('overview'); () => this.remove_style_pseudo_class('overview'),
}); this);
Main.layoutManager.panelBox.add_child(this); Main.layoutManager.panelBox.add_child(this);
Main.ctrlAltTabManager.addGroup(this, Main.ctrlAltTabManager.addGroup(this,