[gnome-shell] [overview] Fix dnd on mulit screen setups



commit fe91f7fe9ec6c5dfa91b364107e6fe773e022bd9
Author: Adel Gadllah <adel gadllah gmail com>
Date:   Wed Jun 2 18:38:31 2010 +0200

    [overview] Fix dnd on mulit screen setups
    
    Currently we don't get any drop events for dual screen modes with a screen
    at the right, and behave weird by hardcoding the screen size and 0 as drag
    edges.
    
    Fix that by spawning the drop group over the whole stage and take the primary monitors position and size into account in _handleDragOver.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=620378

 js/ui/workspacesView.js |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js
index 8eb74d4..0e0bf7c 100644
--- a/js/ui/workspacesView.js
+++ b/js/ui/workspacesView.js
@@ -665,10 +665,10 @@ SingleView.prototype = {
         this._animatingScroll = false; // programatically move the scroll bar
         this._inDrag = false; // dragging a window
         this._lastMotionTime = -1; // used to track "stopping" while dragging workspaces
-        let primary = global.get_primary_monitor();
+
         this._dropGroup = new Clutter.Group({ x: 0, y: 0,
-                                              width: primary.width,
-                                              height: primary.height });
+                                              width: global.screen_width,
+                                              height: global.screen_height });
         this._dropGroup._delegate = this;
         global.stage.add_actor(this._dropGroup);
         this._dropGroup.lower_bottom();
@@ -1195,19 +1195,20 @@ SingleView.prototype = {
 
     handleDragOver: function(self, actor, x, y) {
         let onPanel = false;
-
+        let primary = global.get_primary_monitor();
         let activeWorkspaceIndex = global.screen.get_active_workspace_index();
-        if (x == 0 && activeWorkspaceIndex > 0 && this._dragOverLastX !== 0) {
+
+        if (x <= primary.x && activeWorkspaceIndex > 0 && this._dragOverLastX !== primary.x) {
             this._workspaces[activeWorkspaceIndex - 1].metaWorkspace.activate(global.get_current_time());
             this._workspaces[activeWorkspaceIndex - 1].setReservedSlot(actor._delegate);
-            this._dragOverLastX = 0;
+            this._dragOverLastX = primary.x;
             return;
         }
-        if (x == global.screen_width - 1 && this._workspaces[activeWorkspaceIndex + 1] &&
-            this._dragOverLastX != global.screen_width - 1) {
+        if (x >= primary.x + primary.width - 1 && this._workspaces[activeWorkspaceIndex + 1] &&
+            this._dragOverLastX != primary.x + primary.width - 1) {
             this._workspaces[activeWorkspaceIndex + 1].metaWorkspace.activate(global.get_current_time());
             this._workspaces[activeWorkspaceIndex + 1].setReservedSlot(actor._delegate);
-            this._dragOverLastX = global.screen_width - 1;
+            this._dragOverLastX = primary.x + primary.width - 1;
             return;
         }
 



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