dash: Use a single code path for clearing the drag placeholder
We currently only keep track of old placeholders when moving past the dragged app's current favorite position, as this is the only case where we need to worry about jitter. Still, moving it into _clearDragPlaceholder() allows us to consolidate code paths, which is a good thing ... https://bugzilla.gnome.org/show_bug.cgi?id=684618
This commit is contained in:
parent
4b95be6a95
commit
1902f4773b
@ -791,7 +791,12 @@ const Dash = new Lang.Class({
|
|||||||
|
|
||||||
_clearDragPlaceholder: function() {
|
_clearDragPlaceholder: function() {
|
||||||
if (this._dragPlaceholder) {
|
if (this._dragPlaceholder) {
|
||||||
|
this._animatingPlaceholdersCount++;
|
||||||
this._dragPlaceholder.animateOutAndDestroy();
|
this._dragPlaceholder.animateOutAndDestroy();
|
||||||
|
this._dragPlaceholder.connect('destroy',
|
||||||
|
Lang.bind(this, function() {
|
||||||
|
this._animatingPlaceholdersCount--;
|
||||||
|
}));
|
||||||
this._dragPlaceholder = null;
|
this._dragPlaceholder = null;
|
||||||
}
|
}
|
||||||
this._dragPlaceholderPos = -1;
|
this._dragPlaceholderPos = -1;
|
||||||
@ -828,16 +833,7 @@ const Dash = new Lang.Class({
|
|||||||
|
|
||||||
// Don't allow positioning before or after self
|
// Don't allow positioning before or after self
|
||||||
if (favPos != -1 && (pos == favPos || pos == favPos + 1)) {
|
if (favPos != -1 && (pos == favPos || pos == favPos + 1)) {
|
||||||
if (this._dragPlaceholder) {
|
this._clearDragPlaceholder();
|
||||||
this._dragPlaceholder.animateOutAndDestroy();
|
|
||||||
this._animatingPlaceholdersCount++;
|
|
||||||
this._dragPlaceholder.connect('destroy',
|
|
||||||
Lang.bind(this, function() {
|
|
||||||
this._animatingPlaceholdersCount--;
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
this._dragPlaceholder = null;
|
|
||||||
|
|
||||||
return DND.DragMotionResult.CONTINUE;
|
return DND.DragMotionResult.CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user