From 47f7fcd4fe8d022a1017aaafd3395364ccac062d Mon Sep 17 00:00:00 2001 From: Jean-Philippe Braun Date: Thu, 26 Jan 2012 15:35:31 +0100 Subject: [PATCH] dash: Fix placeholder jumps while dragging a dash item We are currently taking "old" placeholders that are still animating out into account to calculate the new placeholder position - this causes an annoying bug, where dragging a dash item downwards triggers quick continous position changes of the placeholder. Just ignoring old placeholders fixes the issue. https://bugzilla.gnome.org/show_bug.cgi?id=651842 --- js/ui/dash.js | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/js/ui/dash.js b/js/ui/dash.js index a163bed0f..33bfc8435 100644 --- a/js/ui/dash.js +++ b/js/ui/dash.js @@ -744,20 +744,10 @@ const Dash = new Lang.Class({ numChildren--; } - let pos = Math.round(y * numChildren / boxHeight); + let pos = Math.floor(y * numChildren / boxHeight); - if (pos != this._dragPlaceholderPos && pos <= numFavorites) { - if (this._animatingPlaceholdersCount > 0) { - let appChildren = children.filter(function(actor) { - return actor._delegate && - actor._delegate.child && - actor._delegate.child._delegate && - actor._delegate.child._delegate.app; - }); - this._dragPlaceholderPos = children.indexOf(appChildren[pos]); - } else { - this._dragPlaceholderPos = pos; - } + if (pos != this._dragPlaceholderPos && pos <= numFavorites && this._animatingPlaceholdersCount == 0) { + this._dragPlaceholderPos = pos; // Don't allow positioning before or after self if (favPos != -1 && (pos == favPos || pos == favPos + 1)) {