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
This commit is contained in:
parent
31af220483
commit
b047a37a80
@ -793,6 +793,14 @@ const Dash = new Lang.Class({
|
|||||||
this._dragPlaceholder.animateIn();
|
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);
|
let srcIsFavorite = (favPos != -1);
|
||||||
|
|
||||||
if (srcIsFavorite)
|
if (srcIsFavorite)
|
||||||
@ -835,6 +843,11 @@ const Dash = new Lang.Class({
|
|||||||
favPos++;
|
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,
|
Meta.later_add(Meta.LaterType.BEFORE_REDRAW, Lang.bind(this,
|
||||||
function () {
|
function () {
|
||||||
let appFavorites = AppFavorites.getAppFavorites();
|
let appFavorites = AppFavorites.getAppFavorites();
|
||||||
|
Loading…
Reference in New Issue
Block a user