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
This commit is contained in:
Jasper St. Pierre 2013-02-16 23:28:29 -05:00
parent df9b0c548e
commit b53d1df4df
2 changed files with 10 additions and 2 deletions

View File

@ -131,6 +131,9 @@ function start() {
screenShield = new ScreenShield.ScreenShield(); screenShield = new ScreenShield.ScreenShield();
else else
screenShield = new ScreenShield.ScreenShieldFallback(); screenShield = new ScreenShield.ScreenShieldFallback();
// The message tray relies on being constructed
// after the panel.
panel = new Panel.Panel(); panel = new Panel.Panel();
messageTray = new MessageTray.MessageTray(); messageTray = new MessageTray.MessageTray();
keyboard = new Keyboard.Keyboard(); keyboard = new Keyboard.Keyboard();

View File

@ -1651,8 +1651,6 @@ const MessageTray = new Lang.Class({
{ keybindingMode: Shell.KeyBindingMode.MESSAGE_TRAY }); { keybindingMode: Shell.KeyBindingMode.MESSAGE_TRAY });
this._grabHelper.addActor(this._summaryBoxPointer.actor); this._grabHelper.addActor(this._summaryBoxPointer.actor);
this._grabHelper.addActor(this.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)); Main.layoutManager.connect('keyboard-visible-changed', Lang.bind(this, this._onKeyboardVisibleChanged));
@ -1707,6 +1705,8 @@ const MessageTray = new Lang.Class({
this._updateState(); this._updateState();
})); }));
// Track if we've added the activities button
this._activitiesButtonAdded = false;
Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated)); Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
Main.wm.addKeybinding('toggle-message-tray', Main.wm.addKeybinding('toggle-message-tray',
@ -1802,6 +1802,11 @@ const MessageTray = new Lang.Class({
}, },
_sessionUpdated: function() { _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) { if ((Main.sessionMode.isLocked || Main.sessionMode.isGreeter) && this._inCtrlAltTab) {
Main.ctrlAltTabManager.removeGroup(this._summary); Main.ctrlAltTabManager.removeGroup(this._summary);
this._inCtrlAltTab = false; this._inCtrlAltTab = false;