[gnome-shell] [dash] Enable DND of search results



commit 67e70df0c9033bfb1309dbdf8e4137b2a0d36785
Author: Florian Müllner <fmuellner src gnome org>
Date:   Sun Feb 7 18:59:30 2010 +0100

    [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 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/dash.js b/js/ui/dash.js
index 54ff6eb..90c8abe 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);
     }
 }
 



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