[gnome-shell] dash: Don't favorite items dropped at their original position



commit b047a37a80f74a6cf0e744e927605430307e68d4
Author: Jean-Philippe Braun <eon patapon info>
Date:   Thu Jan 26 10:20:03 2012 +0100

    dash: Don't favorite items dropped at their original position
    
    Remove the drag placeholder when the dragged item is outside
    the favorites. Dash items can be favorite only if the drag
    placeholder exists.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=656333

 js/ui/dash.js |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/dash.js b/js/ui/dash.js
index 018674b..af56a0d 100644
--- a/js/ui/dash.js
+++ b/js/ui/dash.js
@@ -793,6 +793,14 @@ const Dash = new Lang.Class({
                 this._dragPlaceholder.animateIn();
         }
 
+        // Remove the drag placeholder if we are not in the
+        // "favorites zone"
+        if (pos > numFavorites && this._dragPlaceholder) {
+            this._clearDragPlaceholder();
+        }
+        if (!this._dragPlaceholder)
+            return DND.DragMotionResult.NO_DROP;
+
         let srcIsFavorite = (favPos != -1);
 
         if (srcIsFavorite)
@@ -835,6 +843,11 @@ const Dash = new Lang.Class({
                 favPos++;
         }
 
+        // No drag placeholder means we don't wan't to favorite the app
+        // and we are dragging it to its original position
+        if (!this._dragPlaceholder)
+            return true;
+
         Meta.later_add(Meta.LaterType.BEFORE_REDRAW, Lang.bind(this,
             function () {
                 let appFavorites = AppFavorites.getAppFavorites();



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