[gnome-shell] overview: Allow dropping icons on windows



commit 96dca48b3bb71eb9bd0fc97d7ba8b99f4f727b0c
Author: Adel Gadllah <adel gadllah gmail com>
Date:   Tue Jun 7 23:15:33 2011 +0200

    overview: Allow dropping icons on windows
    
    Currently the user has to find an empty spot in the workspace
    to be able to launcha new instance of an app using dnd.
    
    This is unnecessary hard, so just allow dropping on windows too.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=652079

 js/ui/workspace.js      |   15 +++++++++++++++
 js/ui/workspacesView.js |    4 ++++
 2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/workspace.js b/js/ui/workspace.js
index c734f6f..f1527f4 100644
--- a/js/ui/workspace.js
+++ b/js/ui/workspace.js
@@ -308,6 +308,21 @@ WindowClone.prototype = {
         this.emit('drag-begin');
     },
 
+    _getWorkspaceActor : function() {
+        let index = this.metaWindow.get_workspace().index();
+        return Main.overview.workspaces.getWorkspaceByIndex(index);
+    },
+
+    handleDragOver : function(source, actor, x, y, time) {
+        let workspace = this._getWorkspaceActor();
+        return workspace.handleDragOver(source, actor, x, y, time);
+    },
+
+    acceptDrop : function(source, actor, x, y, time) {
+        let workspace = this._getWorkspaceActor();
+        workspace.acceptDrop(source, actor, x, y, time);
+    },
+
     _onDragCancelled : function (draggable, time) {
         this.emit('drag-cancelled');
     },
diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js
index 573a1b8..9c5b595 100644
--- a/js/ui/workspacesView.js
+++ b/js/ui/workspacesView.js
@@ -149,6 +149,10 @@ WorkspacesView.prototype = {
         return this._workspaces[active];
     },
 
+    getWorkspaceByIndex: function(index) {
+        return this._workspaces[index];
+    },
+
     hide: function() {
         let activeWorkspaceIndex = global.screen.get_active_workspace_index();
         let activeWorkspace = this._workspaces[activeWorkspaceIndex];



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