diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index ec93ce81e..517e7a979 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -611,6 +611,8 @@ const Notification = new Lang.Class({ setImage: function(image) { if (this._imageBin) this.unsetImage(); + if (!image) + return; this._imageBin = new St.Bin(); this._imageBin.child = image; this._imageBin.opacity = 230; diff --git a/js/ui/notificationDaemon.js b/js/ui/notificationDaemon.js index 3aa86689f..1b24883b0 100644 --- a/js/ui/notificationDaemon.js +++ b/js/ui/notificationDaemon.js @@ -388,8 +388,8 @@ const NotificationDaemon = new Lang.Class({ clear: true }); // We only display a large image if an icon is also specified. + let image = null; if (icon && (hints['image-data'] || hints['image-path'])) { - let image = null; if (hints['image-data']) { let [width, height, rowStride, hasAlpha, bitsPerSample, nChannels, data] = hints['image-data']; @@ -400,10 +400,8 @@ const NotificationDaemon = new Lang.Class({ notification.IMAGE_SIZE, notification.IMAGE_SIZE); } - notification.setImage(image); - } else { - notification.unsetImage(); } + notification.setImage(image); if (actions.length) { notification.setUseActionIcons(hints['action-icons'] == true);