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
This commit is contained in:
Adel Gadllah 2011-06-07 23:15:33 +02:00
parent 1309b64c33
commit 96dca48b3b
2 changed files with 19 additions and 0 deletions

View File

@ -308,6 +308,21 @@ WindowClone.prototype = {
this.emit('drag-begin'); 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) { _onDragCancelled : function (draggable, time) {
this.emit('drag-cancelled'); this.emit('drag-cancelled');
}, },

View File

@ -149,6 +149,10 @@ WorkspacesView.prototype = {
return this._workspaces[active]; return this._workspaces[active];
}, },
getWorkspaceByIndex: function(index) {
return this._workspaces[index];
},
hide: function() { hide: function() {
let activeWorkspaceIndex = global.screen.get_active_workspace_index(); let activeWorkspaceIndex = global.screen.get_active_workspace_index();
let activeWorkspace = this._workspaces[activeWorkspaceIndex]; let activeWorkspace = this._workspaces[activeWorkspaceIndex];