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:
parent
cc60ce7f94
commit
3ef86b279a
@ -411,10 +411,8 @@ export class Notification extends GObject.Object {
|
|||||||
if (params.clear)
|
if (params.clear)
|
||||||
this.clearActions();
|
this.clearActions();
|
||||||
|
|
||||||
if (this.sound !== params.sound) {
|
if (this.sound !== params.sound)
|
||||||
this.sound = params.sound;
|
this.sound = params.sound;
|
||||||
this._soundPlayed = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.emit('updated', params.clear);
|
this.emit('updated', params.clear);
|
||||||
}
|
}
|
||||||
@ -495,14 +493,9 @@ export class Notification extends GObject.Object {
|
|||||||
}
|
}
|
||||||
|
|
||||||
playSound() {
|
playSound() {
|
||||||
if (this._soundPlayed)
|
if (!this.source.policy.enableSound)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!this.source.policy.enableSound) {
|
|
||||||
this._soundPlayed = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.sound?.play(this.title);
|
this.sound?.play(this.title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user