[gnome-shell/gnome-3-6] MessageTray: fix reentrancy when calling out to the grab helper



commit 537297a6ded6f9efd6cd7af5f2189b59629a75fa
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Tue Sep 11 00:44:28 2012 +0200

    MessageTray: fix reentrancy when calling out to the grab helper
    
    Similar to 683546. I'm not sure where this bug lives, but let's make
    the code robust.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=683986

 js/ui/messageTray.js |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index c213e92..71ebb29 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -2277,6 +2277,18 @@ const MessageTray = new Lang.Class({
     },
 
     _hideNotification: function() {
+        // HACK!
+        // There seems to be a reentrancy issue in calling .ungrab() here,
+        // which causes _updateState to be called before _notificationState
+        // becomes HIDING. That hides the notification again, nullifying the
+        // object but not setting _notificationState (and that's the weird part)
+        // As then _notificationState is stuck into SHOWN but _notification
+        // is null, every new _updateState fails and the message tray is
+        // lost forever.
+        //
+        // See more at https://bugzilla.gnome.org/show_bug.cgi?id=683986
+        this._notificationState = State.HIDING;
+
         this._grabHelper.ungrab({ actor: this._notification.actor });
 
         if (this._notificationExpandedId) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]