[gnome-shell/wip/rstrode/rhel-7.9: 72/86] appDisplay: Clear AllView reference to current popup when destroyed




commit 0a24fb19b6e536c3af4f1b694108c2bb461186c8
Author: Ray Strode <rstrode redhat com>
Date:   Thu Jul 18 10:06:38 2019 -0400

    appDisplay: Clear AllView reference to current popup when destroyed
    
    AllView contains a reference to the current popup that lingers after
    the popup is destroyed.
    
    This commit fixes that, by explicitly nullifying when appropriate.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/628

 js/ui/appDisplay.js | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index bb2da39c95..756e8ae44f 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -426,6 +426,7 @@ var AllView = new Lang.Class({
         this._eventBlocker.add_action(this._clickAction);
 
         this._displayingPopup = false;
+        this._currentPopupDestroyId = 0;
 
         this._availWidth = 0;
         this._availHeight = 0;
@@ -719,7 +720,22 @@ var AllView = new Lang.Class({
         this._stack.add_actor(popup.actor);
         popup.connect('open-state-changed', (popup, isOpen) => {
             this._eventBlocker.reactive = isOpen;
-            this._currentPopup = isOpen ? popup : null;
+
+            if (this._currentPopup) {
+                this._currentPopup.actor.disconnect(this._currentPopupDestroyId);
+                this._currentPopupDestroyId = 0;
+            }
+
+            this._currentPopup = null;
+
+            if (isOpen) {
+                this._currentPopup = popup;
+                this._currentPopupDestroyId = popup.actor.connect('destroy', () => {
+                    this._currentPopup = null;
+                    this._currentPopupDestroyId = 0;
+                    this._eventBlocker.reactive = false;
+                });
+            }
             this._updateIconOpacities(isOpen);
             if(!isOpen)
                 this._closeSpaceForPopup();


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