messageTray: Ignore showBanners policy for critical notifications

The critical hint is meant to be used for notifications that must not
be missed - running out of battery being the prime example - so it
makes sense to ignore the policy in that case and make sure to always
show them to the user. This is consistent with blocking normal
notifications while showing a fullscreen window, but letting critical
ones through.

https://bugzilla.gnome.org/show_bug.cgi?id=779974
This commit is contained in:
Florian Müllner 2017-03-13 20:32:06 +01:00
parent e039871298
commit 60a2794c8b

View File

@ -803,7 +803,7 @@ const Source = new Lang.Class({
notification.acknowledged = false; notification.acknowledged = false;
this.pushNotification(notification); this.pushNotification(notification);
if (this.policy.showBanners) { if (this.policy.showBanners || notification.urgency == Urgency.CRITICAL) {
this.emit('notify', notification); this.emit('notify', notification);
} else { } else {
notification.playSound(); notification.playSound();