[gnome-shell/wip/swarm: 3/9] appDisplay: avoid allocation loop



commit 6e403e7abcdcb07a67988c7c2262094a3d6c7906
Author: Carlos Soriano <carlos soriano89 gmail com>
Date:   Thu Jun 19 11:41:47 2014 +0200

    appDisplay: avoid allocation loop

 js/ui/appDisplay.js |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 8274aba..b0ebeda 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -459,7 +459,16 @@ const AllView = new Lang.Class({
                 function() {
                     if (this._grid.actor.mapped) {
                         this._grid.actor.disconnect(toAnimate);
-                        gridAnimationFunction();
+                        // We need to avoid the clutter allocation loop, so we use
+                        // a call before redraw, but also we need to hide items
+                        // to not show them for a moment before the animation is
+                        // started
+                        this._grid.actor.opacity = 0;
+                        Meta.later_add(Meta.LaterType.BEFORE_REDRAW, Lang.bind(this,
+                            function() {
+                                this._grid.actor.opacity = 255;
+                                gridAnimationFunction();
+                            }));
                     }
                 }));
         } else {
@@ -742,7 +751,16 @@ const FrequentView = new Lang.Class({
                 function() {
                     if (this._grid.actor.mapped) {
                         this._grid.actor.disconnect(toAnimate);
-                        gridAnimationFunction();
+                        // We need to avoid the clutter allocation loop, so we use
+                        // a call before redraw, but also we need to hide items
+                        // to not show them for a moment before the animation is
+                        // started
+                        this._grid.actor.opacity = 0;
+                        Meta.later_add(Meta.LaterType.BEFORE_REDRAW, Lang.bind(this,
+                            function() {
+                                this._grid.actor.opacity = 255;
+                                gridAnimationFunction();
+                            }));
                     }
                 }));
         } else {


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