[dash] Enable DND of search results

Allow dragging search results to a specific workspace to launch them
on that workspace; the drag icon is the icon from the search result.

https://bugzilla.gnome.org/show_bug.cgi?id=609218
This commit is contained in:
Florian Müllner 2010-02-07 18:59:30 +01:00
parent fc0acc9e37
commit 67e70df0c9

View File

@ -13,6 +13,7 @@ const Gettext = imports.gettext.domain('gnome-shell');
const _ = Gettext.gettext;
const AppDisplay = imports.ui.appDisplay;
const DND = imports.ui.dnd;
const DocDisplay = imports.ui.docDisplay;
const PlaceDisplay = imports.ui.placeDisplay;
const GenericDisplay = imports.ui.genericDisplay;
@ -363,6 +364,8 @@ SearchResult.prototype = {
this.actor.set_child(content);
this.actor.connect('clicked', Lang.bind(this, this._onResultClicked));
let draggable = DND.makeDraggable(this.actor);
},
setSelected: function(selected) {
@ -376,6 +379,18 @@ SearchResult.prototype = {
_onResultClicked: function(actor, event) {
this.activate();
},
getDragActorSource: function() {
return this.metaInfo['icon'];
},
getDragActor: function(stageX, stageY) {
return new Clutter.Clone({ source: this.metaInfo['icon'] });
},
shellWorkspaceLaunch: function() {
this.provider.activateResult(this.metaInfo.id);
}
}