[gnome-shell] messageTray: Re-add the hotcorner when the panel is updated



commit b53d1df4dfa8825b2209f7825e4aa638e8662f90
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Sat Feb 16 23:28:29 2013 -0500

    messageTray: Re-add the hotcorner when the panel is updated
    
    The activities button may come and go at any moment now that we
    have a dynamic panel. We need to re-check the activities button
    whenever the panel is updated.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=694038

 js/ui/main.js        |    3 +++
 js/ui/messageTray.js |    9 +++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/main.js b/js/ui/main.js
index e493a90..ae0754a 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -131,6 +131,9 @@ function start() {
         screenShield = new ScreenShield.ScreenShield();
     else
         screenShield = new ScreenShield.ScreenShieldFallback();
+
+    // The message tray relies on being constructed
+    // after the panel.
     panel = new Panel.Panel();
     messageTray = new MessageTray.MessageTray();
     keyboard = new Keyboard.Keyboard();
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index 28ec5f3..ce72136 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -1651,8 +1651,6 @@ const MessageTray = new Lang.Class({
                                                      { keybindingMode: Shell.KeyBindingMode.MESSAGE_TRAY });
         this._grabHelper.addActor(this._summaryBoxPointer.actor);
         this._grabHelper.addActor(this.actor);
-        if (Main.panel.statusArea.activities)
-            this._grabHelper.addActor(Main.panel.statusArea.activities.hotCorner.actor);
 
         Main.layoutManager.connect('keyboard-visible-changed', Lang.bind(this, 
this._onKeyboardVisibleChanged));
 
@@ -1707,6 +1705,8 @@ const MessageTray = new Lang.Class({
                 this._updateState();
             }));
 
+        // Track if we've added the activities button
+        this._activitiesButtonAdded = false;
         Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
 
         Main.wm.addKeybinding('toggle-message-tray',
@@ -1802,6 +1802,11 @@ const MessageTray = new Lang.Class({
     },
 
     _sessionUpdated: function() {
+        if (!this._activitiesButtonAdded && Main.panel.statusArea.activities) {
+            this._activitiesButtonAdded = true;
+            this._grabHelper.addActor(Main.panel.statusArea.activities.hotCorner.actor);
+        }
+
         if ((Main.sessionMode.isLocked || Main.sessionMode.isGreeter) && this._inCtrlAltTab) {
             Main.ctrlAltTabManager.removeGroup(this._summary);
             this._inCtrlAltTab = false;


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