[gnome-shell-extensions] window-list: fix overview animation



commit bf789608dfdf8725f8a89c8a64b25e6e1832913f
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Wed Feb 5 12:25:09 2014 +0100

    window-list: fix overview animation
    
    Animate showing and hiding the window list when toggling the
    overview (with a translation on and off the screen). Don't actually
    change the visible status of the actor, because we don't want
    to change struts.

 extensions/window-list/extension.js |   23 ++++++++++++++++++++---
 1 files changed, 20 insertions(+), 3 deletions(-)
---
diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js
index ad914fb..4f02d83 100644
--- a/extensions/window-list/extension.js
+++ b/extensions/window-list/extension.js
@@ -10,8 +10,10 @@ const DND = imports.ui.dnd;
 const Lang = imports.lang;
 const Main = imports.ui.main;
 const MessageTray = imports.ui.messageTray;
+const Overview = imports.ui.overview;
 const PanelMenu = imports.ui.panelMenu;
 const PopupMenu = imports.ui.popupMenu;
+const Tweener = imports.ui.tweener;
 
 const ExtensionUtils = imports.misc.extensionUtils;
 const Me = ExtensionUtils.getCurrentExtension();
@@ -771,7 +773,12 @@ const WindowList = new Lang.Class({
 
         this._overviewShowingId =
             Main.overview.connect('showing', Lang.bind(this, function() {
-                this.actor.hide();
+                // revert layout manager showing us
+                this.actor.visible = !Main.layoutManager.primaryMonitor.inFullscreen;
+
+                Tweener.addTween(this.actor,
+                                 { opacity: 0,
+                                   time: Overview.SHADE_ANIMATION_TIME });
                 this._updateKeyboardAnchor();
                 this._updateMessageTrayAnchor();
             }));
@@ -779,6 +786,15 @@ const WindowList = new Lang.Class({
         this._overviewHidingId =
             Main.overview.connect('hiding', Lang.bind(this, function() {
                 this.actor.visible = !Main.layoutManager.primaryMonitor.inFullscreen;
+                Tweener.addTween(this.actor,
+                                 { opacity: 255,
+                                   time: Overview.SHADE_ANIMATION_TIME });
+
+                this._updateKeyboardAnchor();
+                this._updateMessageTrayAnchor();
+            }));
+        this._overviewHiddenId =
+            Main.overview.connect('hidden', Lang.bind(this, function() {
                 this._updateKeyboardAnchor();
                 this._updateMessageTrayAnchor();
             }));
@@ -839,12 +855,12 @@ const WindowList = new Lang.Class({
         if (!Main.keyboard.actor)
             return;
 
-        let anchorY = Main.overview.visible ? 0 : this.actor.height;
+        let anchorY = (Main.overview.visible || !this.actor.visible) ? 0 : this.actor.height;
         Main.keyboard.actor.anchor_y = anchorY;
     },
 
     _updateMessageTrayAnchor: function() {
-        let anchorY = this.actor.visible ? this.actor.height : 0;
+        let anchorY = (Main.overview.visible || !this.actor.visible) ? 0 : this.actor.height;
 
         Main.messageTray.actor.anchor_y = anchorY;
         Main.messageTray._notificationWidget.anchor_y = -anchorY;
@@ -1018,6 +1034,7 @@ const WindowList = new Lang.Class({
 
         Main.overview.disconnect(this._overviewShowingId);
         Main.overview.disconnect(this._overviewHidingId);
+        Main.overview.disconnect(this._overviewHiddenId);
 
         global.screen.disconnect(this._fullscreenChangedId);
 


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