[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:
parent
fc0acc9e37
commit
67e70df0c9
@ -13,6 +13,7 @@ const Gettext = imports.gettext.domain('gnome-shell');
|
|||||||
const _ = Gettext.gettext;
|
const _ = Gettext.gettext;
|
||||||
|
|
||||||
const AppDisplay = imports.ui.appDisplay;
|
const AppDisplay = imports.ui.appDisplay;
|
||||||
|
const DND = imports.ui.dnd;
|
||||||
const DocDisplay = imports.ui.docDisplay;
|
const DocDisplay = imports.ui.docDisplay;
|
||||||
const PlaceDisplay = imports.ui.placeDisplay;
|
const PlaceDisplay = imports.ui.placeDisplay;
|
||||||
const GenericDisplay = imports.ui.genericDisplay;
|
const GenericDisplay = imports.ui.genericDisplay;
|
||||||
@ -363,6 +364,8 @@ SearchResult.prototype = {
|
|||||||
this.actor.set_child(content);
|
this.actor.set_child(content);
|
||||||
|
|
||||||
this.actor.connect('clicked', Lang.bind(this, this._onResultClicked));
|
this.actor.connect('clicked', Lang.bind(this, this._onResultClicked));
|
||||||
|
|
||||||
|
let draggable = DND.makeDraggable(this.actor);
|
||||||
},
|
},
|
||||||
|
|
||||||
setSelected: function(selected) {
|
setSelected: function(selected) {
|
||||||
@ -376,6 +379,18 @@ SearchResult.prototype = {
|
|||||||
|
|
||||||
_onResultClicked: function(actor, event) {
|
_onResultClicked: function(actor, event) {
|
||||||
this.activate();
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user