[gnome-shell] dash: Fix placeholder jumps while dragging a dash item



commit 47f7fcd4fe8d022a1017aaafd3395364ccac062d
Author: Jean-Philippe Braun <eon patapon info>
Date:   Thu Jan 26 15:35:31 2012 +0100

    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 |   18 ++++--------------
 1 files changed, 4 insertions(+), 14 deletions(-)
---
diff --git a/js/ui/dash.js b/js/ui/dash.js
index a163bed..33bfc84 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);
-
-        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;
-            }
+        let pos = Math.floor(y * numChildren / boxHeight);
+
+        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)) {



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