messageTray: Always play sound when a notification is updated

We had a policy (see [1]) to replay sound for updated notification only
when the sound changed. But this behavior never worked because of a bug
in the code. Since nobody noticed in years, let's remove it and always
allow the sound to be played.

[1] https://bugzilla.gnome.org/show_bug.cgi?id=642831#c37

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3173>
This commit is contained in:
Julian Sparber 2024-03-02 20:34:39 +01:00 committed by Florian Müllner
parent cc60ce7f94
commit 3ef86b279a

View File

@ -411,10 +411,8 @@ export class Notification extends GObject.Object {
if (params.clear)
this.clearActions();
if (this.sound !== params.sound) {
if (this.sound !== params.sound)
this.sound = params.sound;
this._soundPlayed = false;
}
this.emit('updated', params.clear);
}
@ -495,14 +493,9 @@ export class Notification extends GObject.Object {
}
playSound() {
if (this._soundPlayed)
if (!this.source.policy.enableSound)
return;
if (!this.source.policy.enableSound) {
this._soundPlayed = true;
return;
}
this.sound?.play(this.title);
}