[gnome-shell] [appDisplay,placeDisplay] Remove manual dnd mode



commit feaaefd8ba71810639645ba8a1b87a2b13b4603b
Author: Florian Müllner <fmuellner src gnome org>
Date:   Sat Mar 27 02:35:34 2010 +0100

    [appDisplay,placeDisplay] Remove manual dnd mode
    
    As the special handling for St.Clickable moved into dnd, it is no
    longer necessary to use manual mode in these cases.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=610385

 js/ui/appDisplay.js   |   32 +++++---------------------------
 js/ui/placeDisplay.js |   41 +----------------------------------------
 2 files changed, 6 insertions(+), 67 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 0b979d6..3e589f4 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -405,13 +405,13 @@ AppWellIcon.prototype = {
         this.actor.connect('clicked', Lang.bind(this, this._onClicked));
         this._menu = null;
 
-        this._draggable = DND.makeDraggable(this.actor,
-                                            { manualMode: true });
-        this._dragStartX = null;
-        this._dragStartY = null;
+        this._draggable = DND.makeDraggable(this.actor);
+        this._draggable.connect('drag-begin', Lang.bind(this,
+            function () {
+                this._removeMenuTimeout();
+            }));
 
         this.actor.connect('button-press-event', Lang.bind(this, this._onButtonPress));
-        this.actor.connect('notify::hover', Lang.bind(this, this._onHoverChange));
         this.actor.connect('show', Lang.bind(this, this._onShow));
         this.actor.connect('hide', Lang.bind(this, this._onHideDestroy));
         this.actor.connect('destroy', Lang.bind(this, this._onHideDestroy));
@@ -453,10 +453,6 @@ AppWellIcon.prototype = {
     },
 
     _onButtonPress: function(actor, event) {
-        let [stageX, stageY] = event.get_coords();
-        this._dragStartX = stageX;
-        this._dragStartY = stageY;
-
         let button = event.get_button();
         if (button == 1) {
             this._removeMenuTimeout();
@@ -467,21 +463,6 @@ AppWellIcon.prototype = {
         }
     },
 
-    _onHoverChange: function(actor) {
-        let hover = this.actor.hover;
-        if (!hover) {
-            if (this.actor.held && this._dragStartX != null) {
-                this.actor.fake_release();
-                this._removeMenuTimeout();
-                this._draggable.startDrag(this._dragStartX, this._dragStartY,
-                                          global.get_current_time());
-            } else {
-                this._dragStartX = null;
-                this._dragStartY = null;
-            }
-        }
-    },
-
     _onClicked: function(actor, event) {
         this._removeMenuTimeout();
 
@@ -630,9 +611,6 @@ AppIconMenu.prototype = {
         this._arrowSize = 4; // CSS default
         this._spacing = 0; // CSS default
 
-        this._dragStartX = 0;
-        this._dragStartY = 0;
-
         this.actor = new Shell.GenericContainer({ reactive: true });
         this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
         this.actor.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
diff --git a/js/ui/placeDisplay.js b/js/ui/placeDisplay.js
index 9c2a58b..9361d67 100644
--- a/js/ui/placeDisplay.js
+++ b/js/ui/placeDisplay.js
@@ -440,18 +440,9 @@ DashPlaceDisplayItem.prototype = {
         }
 
         this.actor.connect('clicked', Lang.bind(this, this._onClicked));
-        this.actor.connect('notify::hover',
-                           Lang.bind(this, this._onHoverChanged));
-        this.actor.connect('button-press-event',
-                           Lang.bind(this, this._onButtonPress));
-        this.actor.connect('button-release-event',
-                           Lang.bind(this, this._onButtonRelease));
 
         this.actor._delegate = this;
-        this._dragStartX = null;
-        this._dragStartY = null;
-        this._draggable = DND.makeDraggable(this.actor,
-                                            { manualMode: true });
+        this._draggable = DND.makeDraggable(this.actor);
     },
 
     _onClicked: function(b) {
@@ -459,36 +450,6 @@ DashPlaceDisplayItem.prototype = {
         Main.overview.hide();
     },
 
-    _onButtonPress: function(actor, event) {
-        if (event.get_button() != 1)
-            return false;
-
-        let [stageX, stageY] = event.get_coords();
-        this._dragStartX = stageX;
-        this._dragStartY = stageY;
-        return false;
-    },
-
-    _onButtonRelease: function(actor, event) {
-        if (event.get_button() != 1)
-            return false;
-
-        this._dragStartX = null;
-        this._dragStartY = null;
-        return false;
-    },
-
-    _onHoverChanged: function(button) {
-        let hover = button.hover;
-        if (!hover) {
-            if (button.held && this._dragStartX != null) {
-                button.fake_release();
-                this._draggable.startDrag(this._dragStartX, this._dragStartY,
-                                          global.get_current_time());
-            }
-        }
-    },
-
     getDragActorSource: function() {
         return this._icon;
     },



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