From 67e70df0c9033bfb1309dbdf8e4137b2a0d36785 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sun, 7 Feb 2010 18:59:30 +0100 Subject: [PATCH] [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 --- js/ui/dash.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/js/ui/dash.js b/js/ui/dash.js index 54ff6eb26..90c8abe01 100644 --- a/js/ui/dash.js +++ b/js/ui/dash.js @@ -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); } }