[gnome-shell/gnome-3-6] MessageTray: fix reentrancy problem in hideNotificationCompleted
- From: Florian MÃllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-3-6] MessageTray: fix reentrancy problem in hideNotificationCompleted
- Date: Tue, 12 Feb 2013 14:48:05 +0000 (UTC)
commit 450db05b55fca8f7f0e8acbb0821783863541715
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Sat Dec 22 16:02:19 2012 +0100
MessageTray: fix reentrancy problem in hideNotificationCompleted
Hiding notificationWidget with a telepathy notification causes
unfocused to be emitted, which causes a reentrant updateState.
If another notification is queued, it is shown before the old
one is cleared.
https://bugzilla.gnome.org/show_bug.cgi?id=683986
js/ui/messageTray.js | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index e36f499..ce61e25 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -2171,7 +2171,7 @@ const MessageTray = new Lang.Class({
Lang.bind(this, this._onIdleMonitorWatch));
this._notificationClickedId = this._notification.connect('done-displaying',
Lang.bind(this, this._escapeTray));
- this._notification.connect('unfocused', Lang.bind(this, function() {
+ this._notificationUnfocusedId = this._notification.connect('unfocused', Lang.bind(this, function() {
this._updateState();
}));
this._notificationBin.child = this._notification.actor;
@@ -2317,19 +2317,22 @@ const MessageTray = new Lang.Class({
},
_hideNotificationCompleted: function() {
- this._notificationRemoved = false;
- this._notificationWidget.hide();
- this._closeButton.hide();
- this._pointerInTray = false;
- this.actor.hover = false; // Clutter doesn't emit notify::hover when actors move
- this._notificationBin.child = null;
this._notification.collapseCompleted();
this._notification.disconnect(this._notificationClickedId);
this._notificationClickedId = 0;
+ this._notification.disconnect(this._notificationUnfocusedId);
+ this._notificationUnfocusedId = 0;
let notification = this._notification;
this._notification = null;
if (notification.isTransient)
notification.destroy(NotificationDestroyedReason.EXPIRED);
+
+ this._notificationRemoved = false;
+ this._closeButton.hide();
+ this._pointerInTray = false;
+ this.actor.hover = false; // Clutter doesn't emit notify::hover when actors move
+ this._notificationBin.child = null;
+ this._notificationWidget.hide();
},
_expandNotification: function(autoExpanding) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]