breakManager: Activate wellbeing settings on clicking notification

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8305
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3685>
This commit is contained in:
Philip Withnall 2025-04-02 11:39:45 +01:00 committed by Bruce Leidl
parent 6dd1e99236
commit 554af00a6d

View File

@ -950,7 +950,7 @@ class BreakNotificationSource extends GObject.Object {
} }
if (this._notification === null) { if (this._notification === null) {
this._notification = new BreakNotification(this._source, this._manager); this._notification = new BreakNotification(this._source, this._manager, this._app);
this._notification.connect('destroy', () => (this._notification = null)); this._notification.connect('destroy', () => (this._notification = null));
} }
@ -1306,13 +1306,14 @@ const BreakNotification = GObject.registerClass({
false), false),
}, },
}, class BreakNotification extends MessageTray.Notification { }, class BreakNotification extends MessageTray.Notification {
constructor(source, manager) { constructor(source, manager, app) {
super({ super({
source, source,
resident: true, resident: true,
}); });
this._manager = manager; this._manager = manager;
this._app = app;
this.connect('destroy', this._onDestroy.bind(this)); this.connect('destroy', this._onDestroy.bind(this));
this._delayAction = null; this._delayAction = null;
@ -1320,6 +1321,11 @@ const BreakNotification = GObject.registerClass({
this._takeAction = null; this._takeAction = null;
} }
activate() {
this._app.activate();
super.activate();
}
_onDestroy(_notification, destroyedReason) { _onDestroy(_notification, destroyedReason) {
// If it was destroyed by the user (by pressing the close button), skip // If it was destroyed by the user (by pressing the close button), skip
// the current break. // the current break.