[gnome-shell/wip/swarm: 4/13] appDisplay: avoid allocation loop



commit b7366deccb9fdee500331a8eb36e0d12387e9044
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 c16cb6b..fbf9587 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 {
@@ -745,7 +754,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]