[gnome-shell] xdndHandler: Correctly disconnect the window group visibility handler



commit 0065e2cfac7c59d0f55d37332f76aa1a50a49a42
Author: Adel Gadllah <adel gadllah gmail com>
Date:   Fri Mar 4 08:57:46 2011 +0100

    xdndHandler: Correctly disconnect the window group visibility handler

 js/ui/xdndHandler.js |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/xdndHandler.js b/js/ui/xdndHandler.js
index d33f8af..fe8633a 100644
--- a/js/ui/xdndHandler.js
+++ b/js/ui/xdndHandler.js
@@ -4,7 +4,6 @@ const Clutter = imports.gi.Clutter;
 const Lang = imports.lang;
 const Shell = imports.gi.Shell;
 const Signals = imports.signals;
-const Mainloop = imports.mainloop;
 const DND = imports.ui.dnd;
 
 function XdndHandler() {
@@ -41,9 +40,14 @@ XdndHandler.prototype = {
     // Called when the user cancels the drag (i.e release the button)
     _onLeave: function() {
         if (this._windowGroupVisibilityHandlerId != 0) {
-            Mainloop.source_remove(this._windowGroupVisibilityHandlerId);
+            global.window_group.disconnect(this._windowGroupVisibilityHandlerId);
             this._windowGroupVisibilityHandlerId = 0;
         }
+        if (this._cursorWindowClone) {
+            this._cursorWindowClone.destroy();
+            this._cursorWindowClone = null;
+        }
+
         this.emit('drag-end');
     },
 
@@ -77,8 +81,7 @@ XdndHandler.prototype = {
             // Make sure that the clone has the same position as the source
             this._cursorWindowClone.add_constraint(constraint_position);
         } else {
-            if (this._cursorWindowClone)
-            {
+            if (this._cursorWindowClone) {
                 this._cursorWindowClone.destroy();
                 this._cursorWindowClone = null;
             }



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