[gnome-session] manager: add some phase checking paranoia



commit f8fb3ad12a8a7eb4a4609ac9c2889c5c8f3db908
Author: Ray Strode <rstrode redhat com>
Date:   Thu Feb 17 16:21:58 2011 -0500

    manager: add some phase checking paranoia
    
    When the user confirms logout, make sure we didn't
    already start logging out for other reasons before
    processing the confirmation
    
    Suggestion form Vincent.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=637188

 gnome-session/gsm-manager.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/gnome-session/gsm-manager.c b/gnome-session/gsm-manager.c
index fd8ce42..9935af2 100644
--- a/gnome-session/gsm-manager.c
+++ b/gnome-session/gsm-manager.c
@@ -3104,6 +3104,20 @@ static void
 on_shell_end_session_dialog_confirmed (GsmShell   *shell,
                                        GsmManager *manager)
 {
+        /* Note we're checking for END_SESSION here and
+         * QUERY_END_SESSION in the fallback cases elsewhere.
+         *
+         * That's because they run at different times in the logout
+         * process. The shell combines the inhibit and
+         * confirmation dialogs, so it gets displayed after we've collected
+         * inhibitors. The fallback code has two distinct dialogs, once of
+         * which we can (and do show) before collecting the inhibitors.
+         */
+        if (manager->priv->phase >= GSM_MANAGER_PHASE_END_SESSION) {
+                /* Already shutting down, nothing more to do */
+                return;
+        }
+
         manager->priv->logout_mode = GSM_MANAGER_LOGOUT_MODE_FORCE;
         end_phase (manager);
         disconnect_shell_dialog_signals (manager);



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