From b047a37a80f74a6cf0e744e927605430307e68d4 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Braun Date: Thu, 26 Jan 2012 10:20:03 +0100 Subject: [PATCH] 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 file changed, 13 insertions(+) diff --git a/js/ui/dash.js b/js/ui/dash.js index 018674b34..af56a0d3f 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();