[gnome-shell/wip/swarm: 1/6] appDisplay: avoid allocation loop



commit 939609a4deef361b12a248320d1607665fa7836a
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 894c2aa..fd1ed16 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -457,7 +457,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 {
@@ -739,7 +748,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]