ScreenShield: mark music notifications as acknowledged immediately
After all, the user is seeing it (or will see them before unlocking), so there is no point in queing them as banners. https://bugzilla.gnome.org/show_bug.cgi?id=698812
This commit is contained in:
parent
61fe000daa
commit
2591bc90ac
@ -214,6 +214,7 @@ const NotificationsBox = new Lang.Class({
|
|||||||
|
|
||||||
if (musicNotification != null &&
|
if (musicNotification != null &&
|
||||||
this._musicBin.child == null) {
|
this._musicBin.child == null) {
|
||||||
|
musicNotification.acknowledged = true;
|
||||||
if (musicNotification.actor.get_parent() != null)
|
if (musicNotification.actor.get_parent() != null)
|
||||||
musicNotification.actor.get_parent().remove_actor(musicNotification.actor);
|
musicNotification.actor.get_parent().remove_actor(musicNotification.actor);
|
||||||
this._musicBin.child = musicNotification.actor;
|
this._musicBin.child = musicNotification.actor;
|
||||||
@ -246,6 +247,7 @@ const NotificationsBox = new Lang.Class({
|
|||||||
sourceCountChangedId: 0,
|
sourceCountChangedId: 0,
|
||||||
sourceTitleChangedId: 0,
|
sourceTitleChangedId: 0,
|
||||||
sourceUpdatedId: 0,
|
sourceUpdatedId: 0,
|
||||||
|
sourceNotifyId: 0,
|
||||||
musicNotification: null,
|
musicNotification: null,
|
||||||
sourceBox: null,
|
sourceBox: null,
|
||||||
titleLabel: null,
|
titleLabel: null,
|
||||||
@ -256,6 +258,12 @@ const NotificationsBox = new Lang.Class({
|
|||||||
this._showSource(source, obj, obj.sourceBox);
|
this._showSource(source, obj, obj.sourceBox);
|
||||||
this._notificationBox.add(obj.sourceBox, { x_fill: false, x_align: St.Align.START });
|
this._notificationBox.add(obj.sourceBox, { x_fill: false, x_align: St.Align.START });
|
||||||
|
|
||||||
|
if (obj.musicNotification) {
|
||||||
|
obj.sourceNotifyId = source.connect('notify', Lang.bind(this, function(source, notification) {
|
||||||
|
notification.acknowledged = true;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
obj.sourceCountChangedId = source.connect('count-updated', Lang.bind(this, function(source) {
|
obj.sourceCountChangedId = source.connect('count-updated', Lang.bind(this, function(source) {
|
||||||
this._countChanged(source, obj);
|
this._countChanged(source, obj);
|
||||||
}));
|
}));
|
||||||
@ -336,6 +344,8 @@ const NotificationsBox = new Lang.Class({
|
|||||||
if (obj.musicNotification) {
|
if (obj.musicNotification) {
|
||||||
this._musicBin.child = null;
|
this._musicBin.child = null;
|
||||||
obj.musicNotification = null;
|
obj.musicNotification = null;
|
||||||
|
|
||||||
|
source.disconnect(obj.sourceNotifyId);
|
||||||
}
|
}
|
||||||
|
|
||||||
source.disconnect(obj.sourceDestroyId);
|
source.disconnect(obj.sourceDestroyId);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user