[gnome-shell] search-display: Try harder to use a correct drag actor source



commit b9456caeb0bd83f96c390f328fcccf3297c4d2fa
Author: Florian MÃllner <fmuellner gnome org>
Date:   Fri May 20 13:57:38 2011 +0200

    search-display: Try harder to use a correct drag actor source
    
    Commit 429f809b7 fixed an exception in getDragActorSource(), but
    the returned actor is only an approximation (e.g. in contrast to
    the actual drag actor, it includes the label).
    Try a bit harder to return the correct actor and only fall back to
    the approximation when necessary.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=645990

 js/ui/searchDisplay.js |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/searchDisplay.js b/js/ui/searchDisplay.js
index fdf918f..bdaa59c 100644
--- a/js/ui/searchDisplay.js
+++ b/js/ui/searchDisplay.js
@@ -28,6 +28,7 @@ SearchResult.prototype = {
                                      x_align: St.Align.START,
                                      y_fill: true });
         this.actor._delegate = this;
+        this._dragActorSource = null;
 
         let content = provider.createResultActor(metaInfo, terms);
         if (content == null) {
@@ -37,7 +38,11 @@ SearchResult.prototype = {
             let icon = new IconGrid.BaseIcon(this.metaInfo['name'],
                                              { createIcon: this.metaInfo['createIcon'] });
             content.set_child(icon.actor);
+            this._dragActorSource = icon.icon;
             this.actor.label_actor = icon.label;
+        } else {
+            if (content._delegate && content._delegate.getDragActorSource)
+                this._dragActorSource = content._delegate.getDragActorSource();
         }
         this._content = content;
         this.actor.set_child(content);
@@ -76,6 +81,8 @@ SearchResult.prototype = {
     },
 
     getDragActorSource: function() {
+        if (this._dragActorSource)
+            return this._dragActorSource;
         // not exactly right, but alignment problems are hard to notice
         return this._content;
     },



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