[gnome-shell] Fix dropping window on the indicators and at the screen edge for "+"



commit e9a9a5243c3f039de91f8ad0d97a0c835e5b08c0
Author: Maxim Ermilov <zaspire rambler ru>
Date:   Wed Mar 17 02:21:24 2010 +0300

    Fix dropping window on the indicators and at the screen edge for "+"
    
    https://bugzilla.gnome.org/show_bug.cgi?id=607821

 js/ui/workspacesView.js |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js
index 6555e3d..bfe5f7d 100644
--- a/js/ui/workspacesView.js
+++ b/js/ui/workspacesView.js
@@ -774,6 +774,22 @@ SingleView.prototype = {
     },
 
     acceptDrop: function(source, dropActor, x, y, time) {
+        if (x < this._x || y < this._y || y > this._y + this._height) {
+            this._dropGroup.lower_bottom();
+            dropActor.hide();
+            let target = global.stage.get_actor_at_pos(Clutter.PickMode.ALL, x, y);
+            dropActor.show();
+
+            if (target._delegate && target._delegate != this && target._delegate.acceptDrop) {
+                let [targX, targY] = target.get_transformed_position();
+                return target._delegate.acceptDrop(source, dropActor,
+                                                   (x - targX) / target.scale_x,
+                                                   (y - targY) / target.scale_y,
+                                                   time);
+            }
+            return false;
+        }
+
         for (let i = 0; i < this._workspaces.length; i++) {
             let [dx, dy] = this._workspaces[i].actor.get_transformed_position();
             let [dw, dh] = this._workspaces[i].actor.get_transformed_size();
@@ -784,7 +800,7 @@ SingleView.prototype = {
 
         let [dx, dy] = this._newWorkspaceArea.actor.get_transformed_position();
         let [dw, dh] = this._newWorkspaceArea.actor.get_transformed_size();
-        if (x > dx && x < dx + dw && y > dy && y < dy + dh)
+        if (x > dx && y > dy && y < dy + dh)
             return this._acceptNewWorkspaceDrop(source, dropActor, x, y, time);
 
         return false;
@@ -822,7 +838,7 @@ SingleView.prototype = {
 
         let [dx, dy] = this._newWorkspaceArea.actor.get_transformed_position();
         let [dw, dh] = this._newWorkspaceArea.actor.get_transformed_size();
-        this._newWorkspaceArea.setStyle(x > dx && x < dx + dw && y > dy && y < dy + dh);
+        this._newWorkspaceArea.setStyle(x > dx && y > dy && y < dy + dh);
 
         [dx, dy] = this._leftShadow.get_transformed_position();
         [dw, dh] = this._leftShadow.get_transformed_size();



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