File gnome-session-bsc979257-bgo728151-duplicated-poweroff-dialog.patch of Package gnome-session

From b3b6d74fd1c916d013fa9cc9f1d61970504da1a7 Mon Sep 17 00:00:00 2001
From: Michael Catanzaro <mcatanzaro@gnome.org>
Date: Fri, 16 Sep 2016 12:48:01 -0500
Subject: [PATCH] manager: set phase to running before clearing inhibitors

e83da6fb3c9307895226ae4812ac27b782a57600 introduced a regression where
clicking cancel on the power off dialog causes the dialog to reopen
itself in case any JIT inhibitor has been taken, since the inhibitors
are removed here and removing the inhibitor causing the dialog to reopen
to support functionality that was removed from gnome-shell three years
ago. To fix this, set the manager phase to running before removing the
inhibitors to ensure the power off dialog does not reopen.

https://bugzilla.gnome.org/show_bug.cgi?id=728151
---
 gnome-session/gsm-manager.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/gnome-session/gsm-manager.c b/gnome-session/gsm-manager.c
index 49aa31e..012f3d3 100644
--- a/gnome-session/gsm-manager.c
+++ b/gnome-session/gsm-manager.c
@@ -1071,6 +1071,11 @@ cancel_end_session (GsmManager *manager)
 
         g_cancellable_cancel (manager->priv->end_session_cancellable);
 
+        gsm_manager_set_phase (manager, GSM_MANAGER_PHASE_RUNNING);
+        manager->priv->logout_mode = GSM_MANAGER_LOGOUT_MODE_NORMAL;
+
+        manager->priv->logout_type = GSM_MANAGER_LOGOUT_NONE;
+
         /* clear all JIT inhibitors */
         gsm_store_foreach_remove (manager->priv->inhibitors,
                                   (GsmStoreFunc)inhibitor_is_jit,
@@ -1080,11 +1085,6 @@ cancel_end_session (GsmManager *manager)
                            (GsmStoreFunc)_client_cancel_end_session,
                            NULL);
 
-        gsm_manager_set_phase (manager, GSM_MANAGER_PHASE_RUNNING);
-        manager->priv->logout_mode = GSM_MANAGER_LOGOUT_MODE_NORMAL;
-
-        manager->priv->logout_type = GSM_MANAGER_LOGOUT_NONE;
-
         start_phase (manager);
 }
 
-- 
2.10.0

openSUSE Build Service is sponsored by