ScreenShield: fix fallout from 8cb3884
We must remove music notifications before we're destroyed, otherwise they get destroyed with us. Also, integrate a review comment I previously forgot. https://bugzilla.gnome.org/show_bug.cgi?id=685926
This commit is contained in:
@ -218,9 +218,11 @@ const NotificationsBox = new Lang.Class({
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
let body = '';
|
let body = '';
|
||||||
if (n.bannerBodyText)
|
if (n.bannerBodyText) {
|
||||||
body = n.bannerBodyMarkup ? n.bannerBodyText :
|
body = n.bannerBodyMarkup ? n.bannerBodyText :
|
||||||
GLib.markup_escape_text(n.bannerBodyMarkup, -1);
|
GLib.markup_escape_text(n.bannerBodyMarkup, -1);
|
||||||
|
}
|
||||||
|
|
||||||
let label = new St.Label({ style_class: 'screen-shield-notification-count-text' });
|
let label = new St.Label({ style_class: 'screen-shield-notification-count-text' });
|
||||||
label.clutter_text.set_markup('<b>' + n.title + '</b> ' + body);
|
label.clutter_text.set_markup('<b>' + n.title + '</b> ' + body);
|
||||||
textBox.add(label);
|
textBox.add(label);
|
||||||
@ -356,6 +358,11 @@ const NotificationsBox = new Lang.Class({
|
|||||||
obj.sourceBox.destroy();
|
obj.sourceBox.destroy();
|
||||||
obj.sourceBox = obj.titleLabel = obj.countLabel = null;
|
obj.sourceBox = obj.titleLabel = obj.countLabel = null;
|
||||||
|
|
||||||
|
if (obj.musicNotification) {
|
||||||
|
this._musicBin.child = null;
|
||||||
|
obj.musicNotification = null;
|
||||||
|
}
|
||||||
|
|
||||||
source.disconnect(obj.sourceDestroyId);
|
source.disconnect(obj.sourceDestroyId);
|
||||||
source.disconnect(obj.sourceCountChangedId);
|
source.disconnect(obj.sourceCountChangedId);
|
||||||
source.disconnect(obj.sourceTitleChangedId);
|
source.disconnect(obj.sourceTitleChangedId);
|
||||||
|
Reference in New Issue
Block a user