[gnome-session] Fail whale: Don't offer logout on the login screen



commit a11d6fe2b07524f061f8e9c6cda428906e9cb53e
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Sep 9 17:15:39 2011 -0400

    Fail whale: Don't offer logout on the login screen
    
    We already look at the session type in various places, so
    it is only natural to use the it here too.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=658680

 gnome-session/gsm-manager.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/gnome-session/gsm-manager.c b/gnome-session/gsm-manager.c
index 2d74d40..7dcee3b 100644
--- a/gnome-session/gsm-manager.c
+++ b/gnome-session/gsm-manager.c
@@ -276,10 +276,22 @@ on_required_app_failure (GsmManager  *manager,
         const gchar *app_id;
         gboolean want_extensions_ui;
         gboolean allow_logout;
+        GsmConsolekit *consolekit;
+        char *session_type;
 
         app_id = gsm_app_peek_app_id (app);
         want_extensions_ui = g_str_equal (app_id, "gnome-shell.desktop");
-        allow_logout = !_log_out_is_locked_down (manager);
+
+        consolekit = gsm_get_consolekit ();
+        session_type = gsm_consolekit_get_current_session_type (consolekit);
+        if (g_strcmp0 (session_type, GSM_CONSOLEKIT_SESSION_TYPE_LOGIN_WINDOW) == 0) {
+                allow_logout = FALSE;
+        } else {
+                allow_logout = !_log_out_is_locked_down (manager);
+        }
+        g_object_unref (consolekit);
+        g_free (session_type);
+
         gsm_fail_whale_dialog_we_failed (FALSE,
                                          allow_logout,
                                          want_extensions_ui);



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