[gnome-shell] appDisplay: Remove dragMonitor when FolderIcon is destroyed



commit 766e9034e25edff4eb82ebfec46395f29e1a7b87
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Sat Nov 23 19:57:02 2019 +0100

    appDisplay: Remove dragMonitor when FolderIcon is destroyed
    
    While it should be impossible to destroy a FolderIcon while a DnD action
    is still going on, there might still be rare cases where this happens
    (ie. when a folder is removed because an app got deleted during DnD).
    
    So make sure we're on the safe side here and don't potentially leave
    dragMonitors around after the icon is destroyed by removing the
    dragMonitor inside the onDestroy handler of the FolderIcon, just like we
    do for AppIcons.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/849

 js/ui/appDisplay.js | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 62a99b9fe9..0621acdae4 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1515,6 +1515,11 @@ var FolderIcon = GObject.registerClass({
         Main.overview.disconnect(this._itemDragBeginId);
         Main.overview.disconnect(this._itemDragEndId);
 
+        if (this._dragMonitor) {
+            DND.removeDragMonitor(this._dragMonitor);
+            this._dragMonitor = null;
+        }
+
         this.view.destroy();
 
         if (this._folderChangedId) {


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