From bf789608dfdf8725f8a89c8a64b25e6e1832913f Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Wed, 5 Feb 2014 12:25:09 +0100 Subject: [PATCH] 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 file changed, 20 insertions(+), 3 deletions(-) diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js index ad914fb5..4f02d835 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);