[gnome-shell] Look at current mouse position for dropping



commit 765779272fa2a532cd4c070516a9f6d4bd48d9a2
Author: Maxim Ermilov <zaspire rambler ru>
Date:   Tue Mar 9 01:50:49 2010 +0300

    Look at current mouse position for dropping
    
    Previously we used the top-left corner which was not intuitive,
    particularly when dragging partially opaque actors.
    https://bugzilla.gnome.org/show_bug.cgi?id=607821

 js/ui/dnd.js |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/dnd.js b/js/ui/dnd.js
index 9188cad..717ea18 100644
--- a/js/ui/dnd.js
+++ b/js/ui/dnd.js
@@ -59,7 +59,7 @@ _Draggable.prototype = {
 
         return false;
     },
-    
+
     _grabActor: function() {
         Clutter.grab_pointer(this.actor);
         this._onEventId = this.actor.connect('event',
@@ -220,8 +220,7 @@ _Draggable.prototype = {
             // we have to temporarily hide this._dragActor.
             this._dragActor.hide();
             let target = this._dragActor.get_stage().get_actor_at_pos(Clutter.PickMode.ALL,
-                                                                      stageX + this._dragOffsetX,
-                                                                      stageY + this._dragOffsetY);
+                                                                      stageX, stageY);
             this._dragActor.show();
             while (target) {
                 if (target._delegate && target._delegate.handleDragOver) {
@@ -230,8 +229,8 @@ _Draggable.prototype = {
                     // We can check the return value of the function and break the loop if it's true if we don't want
                     // to continue checking the parents.
                     target._delegate.handleDragOver(this.actor._delegate, this._dragActor,
-                                                    (stageX + this._dragOffsetX - targX) / target.scale_x,
-                                                    (stageY + this._dragOffsetY - targY) / target.scale_y,
+                                                    (stageX - targX) / target.scale_x,
+                                                    (stageY - targY) / target.scale_y,
                                                     event.get_time());
                 }
                 target = target.get_parent();



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