From c11f89e72a35c65142230860ba1fc7268d400fc6 Mon Sep 17 00:00:00 2001 From: Rui Matos Date: Fri, 7 Dec 2012 12:09:42 +0100 Subject: [PATCH] messageTray: Don't add ourselves more than once to CtrlAltTabManager This way _sessionUpdated() can be called multiple times without side effects. https://bugzilla.gnome.org/show_bug.cgi?id=689959 --- js/ui/messageTray.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 6b7199e92..e72e959fc 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -1485,6 +1485,7 @@ const MessageTray = new Lang.Class({ this._reNotifyAfterHideNotification = null; this._inFullscreen = false; this._desktopClone = null; + this._inCtrlAltTab = false; this._lightbox = new Lightbox.Lightbox(global.window_group, { inhibitEvents: true, @@ -1562,12 +1563,15 @@ const MessageTray = new Lang.Class({ }, _sessionUpdated: function() { - if (Main.sessionMode.isLocked || Main.sessionMode.isGreeter) + if ((Main.sessionMode.isLocked || Main.sessionMode.isGreeter) && this._inCtrlAltTab) { Main.ctrlAltTabManager.removeGroup(this._summary); - else + this._inCtrlAltTab = false; + } else if (!this._inCtrlAltTab) { Main.ctrlAltTabManager.addGroup(this._summary, _("Message Tray"), 'user-available-symbolic', { focusCallback: Lang.bind(this, this.toggleAndNavigate), sortGroup: CtrlAltTab.SortGroup.BOTTOM }); + this._inCtrlAltTab = true; + } this._updateState(); },