[gnome-shell/wip/rstrode/rhel-7.9: 71/86] appDisplay: Add AppFolderPopup destroy handler




commit 9f06d6df338d2c90b0a480e75305088400a394bb
Author: Ray Strode <rstrode redhat com>
Date:   Mon Jul 22 11:02:10 2019 -0400

    appDisplay: Add AppFolderPopup destroy handler
    
    At the moment AppFolderPopup calls popdown on destruction,
    which leads to open-state-changed getting emitted after
    the actor associated with the popup is destroyed.
    
    This commit handles ungrabbing and closing from an
    actor destroy handler to side-step the open-state-changed
    signal.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/628

 js/ui/appDisplay.js | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 7bd2b038f2..bb2da39c95 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1475,6 +1475,15 @@ var AppFolderPopup = new Lang.Class({
         this._grabHelper = new GrabHelper.GrabHelper(this.actor);
         this._grabHelper.addActor(Main.layoutManager.overviewGroup);
         this.actor.connect('key-press-event', this._onKeyPress.bind(this));
+        this.actor.connect('destroy', this._onDestroy.bind(this));
+    },
+
+    _onDestroy() {
+        if (this._isOpen) {
+            this._isOpen = false;
+            this._grabHelper.ungrab({ actor: this.actor });
+            this._grabHelper = null;
+        }
     },
 
     _onKeyPress(actor, event) {


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