[gnome-shell/wip/message-tray: 17/18] messageTray: Move the background up/down when the tray is toggled



commit 86f7892621e3b6e2b3e5220ed419bee3cc14f938
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Aug 6 23:14:06 2012 +0200

    messageTray: Move the background up/down when the tray is toggled
    
    This is broken for vertically stacked monitors where the message tray
    is not in the primary monitor.
    
    Fixes: https://bugzilla.gnome.org/677215

 js/ui/messageTray.js |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index ef48651..096b894 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -1500,6 +1500,7 @@ const MessageTray = new Lang.Class({
         this._notificationRemoved = false;
         this._reNotifyAfterHideNotification = null;
         this._inFullscreen = false;
+        this._desktopClone = null;
         this._tweening = 0;
         this._windowsShifted = 0;
         this._buttonReleaseId = 0;
@@ -2085,6 +2086,29 @@ const MessageTray = new Lang.Class({
             this._tweening++;
         }
 
+        let primaryMonitor = Main.layoutManager.primaryMonitor;
+        this._desktopClone = new Clutter.Clone({ source: global.background_actor });
+        this._desktopClone.set_clip(primaryMonitor.x,
+                                    primaryMonitor.y,
+                                    primaryMonitor.width,
+                                    primaryMonitor.height);
+        global.window_group.add_actor(this._desktopClone);
+        this._desktopClone.x = 0;
+        this._desktopClone.y = 0;
+        this._desktopClone.raise(global.background_actor);
+        this._desktopClone.show();
+
+        Tweener.addTween(this._desktopClone,
+                         { y: this._desktopClone.y - this.actor.height,
+                           time: ANIMATION_TIME,
+                           transition: 'easeOutQuad',
+                           onComplete: Lang.bind(this, function() {
+                               this._tweening--;
+                           })
+                         });
+        this._windowsShifted++;
+        this._tweening++;
+
         Main.pushModal(this.actor);
 
         this._buttonReleaseId = global.stage.connect('button-release-event',
@@ -2136,6 +2160,20 @@ const MessageTray = new Lang.Class({
             this._tweening++;
         }
 
+        Tweener.addTween(this._desktopClone,
+                         { y: this._desktopClone.y + this.actor.height,
+                           time: ANIMATION_TIME,
+                           transition: 'easeOutQuad',
+                           onComplete: Lang.bind(this, function() {
+                               this._windowsShifted--;
+                               this._tweening--;
+                               this._desktopClone.hide();
+                               global.window_group.remove_actor(this._desktopClone);
+                               this._desktopClone = null;
+                           })
+                         });
+        this._tweening++;
+
         Main.popModal(this.actor);
 
         if (this._buttonReleaseId > 0) {



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