[gnome-shell/wip/message-tray: 14/19] messageTray: Don't actually move the windows



commit f5ef46dc13d107aaa593afe4312b183a4f8767b9
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/layout.js      |    4 --
 js/ui/messageTray.js |   86 +++++++-------------------------------------------
 2 files changed, 12 insertions(+), 78 deletions(-)
---
diff --git a/js/ui/layout.js b/js/ui/layout.js
index 5f58ff9..0cb0acd 100644
--- a/js/ui/layout.js
+++ b/js/ui/layout.js
@@ -366,10 +366,6 @@ const LayoutManager = new Lang.Class({
         this._chrome.removeActor(actor);
     },
 
-    togglePanelStruts: function() {
-        this._chrome.toggleStruts(this.panelBox);
-    },
-
     findMonitorForActor: function(actor) {
         return this._chrome.findMonitorForActor(actor);
     }
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index bef47e9..e000047 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;
 
         this._corner = new Clutter.Rectangle({ width: 1,
                                                height: 1,
@@ -2014,91 +2012,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;
-
-        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--;
-                               })
-                             });
-            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]