From a901f2dc5db905a1782b0d0ec49a7e1e14448a5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 3 Mar 2012 08:35:03 +0100 Subject: [PATCH] userMenu: Do not save/restore IDLE session status When restoring the previous sesssion presence, we forcefully set gnome-session's status. In the case of IDLE, this will trigger the screensaver, which is clearly unwanted first thing after login. We should only save and restore statuses that are explicitly set by the user anyway, so limit presence saving to AVAILABLE and BUSY statuses. https://bugzilla.gnome.org/show_bug.cgi?id=665701 --- js/ui/userMenu.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/js/ui/userMenu.js b/js/ui/userMenu.js index a99a9d5da..b51adf85b 100644 --- a/js/ui/userMenu.js +++ b/js/ui/userMenu.js @@ -390,6 +390,13 @@ const IMStatusChooserItem = new Lang.Class({ if (!this._sessionPresenceRestored) { let savedStatus = global.settings.get_int('saved-session-presence'); + + // We should never save/restore a status other than AVAILABLE + // or BUSY + if (savedStatus != GnomeSession.PresenceStatus.AVAILABLE && + savedStatus != GnomeSession.PresenceStatus.BUSY) + savedStatus = GnomeSession.PresenceStatus.AVAILABLE; + if (sessionStatus != savedStatus) { this._presence.status = savedStatus; return; @@ -397,7 +404,9 @@ const IMStatusChooserItem = new Lang.Class({ this._sessionPresenceRestored = true; } - global.settings.set_int('saved-session-presence', sessionStatus); + if (sessionStatus == GnomeSession.PresenceStatus.AVAILABLE || + sessionStatus == GnomeSession.PresenceStatus.BUSY) + global.settings.set_int('saved-session-presence', sessionStatus); let [presence, s, msg] = this._accountMgr.get_most_available_presence(); let newPresence, status;