messageTray: Allow settings gobject properties of Source on creation

This also makes the `icon` property of `Source` writable so that it can
be set during creation instead of overriding the getter of the icon
property.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3103>
This commit is contained in:
Julian Sparber
2024-01-25 21:52:34 +01:00
committed by Marge Bot
parent c63d67c9af
commit 932ccac1c2
11 changed files with 69 additions and 69 deletions

View File

@ -60,7 +60,10 @@ class WindowAttentionSource extends MessageTray.Source {
this._window = window;
this._app = app;
super._init(app.get_name());
super._init({
title: this._app.get_name(),
icon: this._app.get_icon(),
});
this._window.connectObject(
'notify::demands-attention', this._sync.bind(this),
@ -84,10 +87,6 @@ class WindowAttentionSource extends MessageTray.Source {
}
}
get icon() {
return this._app.get_icon();
}
destroy(params) {
this._window.disconnectObject(this);