[gnome-shell/wip/pressure: 4/14] messageTray: Don't actually move the windows



commit dbfdafdbb9665fcdd9fc397554ec6f8615fd46c1
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Jul 30 20:22:00 2012 -0300

    messageTray: Don't actually move the windows
    
    Tween the window_group instead. Since we're going to have a grab
    when the message tray is fully open, this makes sense.

 js/ui/messageTray.js |   91 ++++++-------------------------------------------
 1 files changed, 12 insertions(+), 79 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index a29b3a2..8fb41c2 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -1500,8 +1500,6 @@ const MessageTray = new Lang.Class({
         this._notificationRemoved = false;
         this._reNotifyAfterHideNotification = null;
         this._inFullscreen = false;
-        this._tweening = 0;
-        this._windowsShifted = 0;
 
         Main.layoutManager.trayBox.add_actor(this.actor);
         this.actor.y = 0;
@@ -1681,7 +1679,6 @@ const MessageTray = new Lang.Class({
 
     toggle: function() {
         this._traySummoned = !this._traySummoned;
-        Main.layoutManager.togglePanelStruts();
         this._updateState();
     },
 
@@ -1998,95 +1995,31 @@ const MessageTray = new Lang.Class({
     },
 
     _showTray: function() {
-        // Bail out if we are in the middle of tweening the tray or the
-        // windows.
-        if (this._tweening != 0)
+        // Don't move the windows up if we are in the overview.
+        if (this._overviewVisible)
             return;
 
         this._tween(this.actor, '_trayState', State.SHOWN,
                     { y: -this.actor.height,
                       time: ANIMATION_TIME,
-                      transition: 'easeOutQuad',
-                      onComplete:
-                      { apply: Lang.bind(this, function() {
-                            this._tweening--;
-                        })
-                      }
-                    });
-        this._tweening++;
-
-        // Don't move the windows up if we are in the overview.
-        if (this._overviewVisible)
-            return;
-
-        Main.layoutManager.togglePanelStruts();
-
-        let actors = global.get_window_actors();
-        for (let i = 0; i < actors.length; i++) {
-            let window = actors[i].metaWindow;
-            if (!window.is_on_primary_monitor())
-                continue;
+                      transition: 'easeOutQuad' });
 
-            Tweener.addTween(actors[i],
-                             { y: actors[i].y - this.actor.height,
-                               time: ANIMATION_TIME,
-                               transition: 'easeOutQuad',
-                               onComplete: Lang.bind(this, function() {
-                                   let rect = window.get_outer_rect();
-                                   window.move_frame(true, rect.x, rect.y - this.actor.height);
-                                   this._tweening--;
-                               })
-                             });
-            this._windowsShifted++;
-            this._tweening++;
-        }
+        Tweener.addTween(global.window_group,
+                         { y: -this.actor.height,
+                           time: ANIMATION_TIME,
+                           transition: 'easeOutQuad' });
     },
 
     _hideTray: function() {
-        // Bail out if we are in the middle of tweening the tray or the
-        // windows.
-        if (this._tweening != 0)
-            return;
-
         this._tween(this.actor, '_trayState', State.HIDDEN,
                     { y: 0,
                       time: ANIMATION_TIME,
-                      transition: 'easeOutQuad',
-                      onComplete:
-                      { apply: Lang.bind(this, function() {
-                            this._tweening--;
-                        })
-                      }
-                    });
-        this._tweening++;
+                      transition: 'easeOutQuad' });
 
-        // Don't move the windows down if had not moved them up. We can't use
-        // this._overviewVisible to check whether we were in the overview
-        // because it gets unset before this method is invoked.
-        if (this._windowsShifted == 0)
-            return;
-
-        let actors = global.get_window_actors();
-        for (let i = 0; i < actors.length; i++) {
-            let window = actors[i].metaWindow;
-            if (!window.is_on_primary_monitor())
-                continue;
-
-            Tweener.addTween(actors[i],
-                             { y: actors[i].y + this.actor.height,
-                               time: ANIMATION_TIME,
-                               transition: 'easeOutQuad',
-                               onComplete: Lang.bind(this, function() {
-                                   let rect = window.get_outer_rect();
-                                   window.move_frame(true, rect.x, rect.y + this.actor.height);
-                                   this._windowsShifted--;
-                                   this._tweening--;
-                                   if (this._windowsShifted == 0)
-                                       Main.layoutManager.togglePanelStruts();
-                               })
-                             });
-            this._tweening++;
-        }
+        Tweener.addTween(global.window_group,
+                         { y: 0,
+                           time: ANIMATION_TIME,
+                           transition: 'easeOutQuad' });
     },
 
     _onIdleMonitorWatch: function(monitor, id, userBecameIdle) {



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