[gnome-shell/gnome-3-34] appIcon: Remove drag monitor on destroy



commit f8a90f6583df9982b59552a9dfdb2cef2fdd633a
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Thu Nov 21 18:50:11 2019 -0300

    appIcon: Remove drag monitor on destroy
    
    It may happen that the app icon is destroyed with a drag
    monitor still around, in which case, a load of warnings
    will be shown.
    
    Make sure to remove any pending drag monitor on destroy.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/841

 js/ui/appDisplay.js | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index a6b29a31eb..c10ff33195 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -2061,6 +2061,7 @@ var AppIcon = class AppIcon {
             });
         }
 
+        this._dragMonitor = null;
         this._itemDragBeginId = Main.overview.connect(
             'item-drag-begin', this._onDragBegin.bind(this));
         this._itemDragEndId = Main.overview.connect(
@@ -2085,6 +2086,12 @@ var AppIcon = class AppIcon {
         }
         if (this._stateChangedId > 0)
             this.app.disconnect(this._stateChangedId);
+
+        if (this._dragMonitor) {
+            DND.removeDragMonitor(this._dragMonitor);
+            this._dragMonitor = null;
+        }
+
         if (this._draggable) {
             if (this._dragging)
                 Main.overview.endItemDrag(this);


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