[gnome-shell/wip/message-tray: 3/3] messageTray: Move the windows up/down when the tray is toggled



commit 07023c90aa4b84ddbb4b8cd638676092bc79fda2
Author: Debarshi Ray <debarshir gnome org>
Date:   Sat Jul 14 13:10:40 2012 +0200

    messageTray: Move the windows up/down when the tray is toggled
    
    Only the windows on the primary monitor are moved because the
    secondary does not have a message tray.
    
    Fixes: https://bugzilla.gnome.org/677215

 js/ui/messageTray.js |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index d7b7647..4d04ba5 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -1590,6 +1590,11 @@ const MessageTray = new Lang.Class({
         this._isScreenLocked = false;
         Main.screenShield.connect('lock-status-changed', Lang.bind(this, this._onScreenLockStatusChanged));
 
+        global.display.add_keybinding('toggle-message-tray',
+                                      new Gio.Settings({ schema: SHELL_KEYBINDINGS_SCHEMA }),
+                                      Meta.KeyBindingFlags.NONE,
+                                      Lang.bind(this, this.toggle));
+
         this._summaryItems = [];
         // We keep a list of new summary items that were added to the summary since the last
         // time it was shown to the user. We automatically show the summary to the user if there
@@ -1795,6 +1800,7 @@ const MessageTray = new Lang.Class({
 
     toggle: function() {
         this._traySummoned = !this._traySummoned;
+        Main.layoutManager.togglePanelStruts();
         this._updateState();
     },
 
@@ -2248,6 +2254,17 @@ const MessageTray = new Lang.Class({
                       time: ANIMATION_TIME,
                       transition: 'easeOutQuad'
                     });
+
+        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;
+            let rect = window.get_outer_rect();
+            window.move_frame(true, rect.x, rect.y - this.actor.height);
+        }
     },
 
     _hideTray: function() {
@@ -2256,6 +2273,17 @@ const MessageTray = new Lang.Class({
                       time: ANIMATION_TIME,
                       transition: 'easeOutQuad'
                     });
+
+        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;
+            let rect = window.get_outer_rect();
+            window.move_frame(true, rect.x, rect.y + this.actor.height);
+        }
     },
 
     _onIdleMonitorWatch: function(monitor, id, userBecameIdle) {



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