summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-11-04 18:22:03 +0100
committerinfirit <[email protected]>2014-11-04 18:22:03 +0100
commit0b67ce2c762b1aabf12d3f4a80a5c902add5658c (patch)
tree3689adbb4c0afb6e72599936128af305af21c687
parentb78d5b0b2d494d550d88f869c7191597fc2623d8 (diff)
downloadmate-session-manager-0b67ce2c762b1aabf12d3f4a80a5c902add5658c.tar.bz2
mate-session-manager-0b67ce2c762b1aabf12d3f4a80a5c902add5658c.tar.xz
manager: remove client from query clients list on disconnect
When the session manager enters the query end session phase, it temporarily adds all clients to the "query clients" list. This list is used to track the progression of clients quitting. If a client quits during the query end session phase instead of waiting until the end session phase, then it will get destroyed but not get removed from the query clients list. This commit removes it from the query clients list in this case. It does this by explicitly invoking the end session response handler (in effect, the client responded to the end session query by exiting). based on gnome-session commit: 8e6afcf1789c02692cf3b1ff3ee0a792d57e17a3 From: Ray Strode <[email protected]>
-rw-r--r--mate-session/gsm-manager.c53
1 files changed, 47 insertions, 6 deletions
diff --git a/mate-session/gsm-manager.c b/mate-session/gsm-manager.c
index 15a1090..01ebac4 100644
--- a/mate-session/gsm-manager.c
+++ b/mate-session/gsm-manager.c
@@ -175,6 +175,13 @@ static void gsm_manager_class_init (GsmManagerClass *klass);
static void gsm_manager_init (GsmManager *manager);
static void gsm_manager_finalize (GObject *object);
+static void _handle_client_end_session_response (GsmManager *manager,
+ GsmClient *client,
+ gboolean is_ok,
+ gboolean do_last,
+ gboolean cancel,
+ const char *reason);
+
static gboolean auto_save_is_enabled (GsmManager *manager);
static void maybe_save_session (GsmManager *manager);
@@ -1705,6 +1712,24 @@ _disconnect_client (GsmManager *manager,
}
}
+ if (manager->priv->phase == GSM_MANAGER_PHASE_QUERY_END_SESSION) {
+ /* Instead of answering our end session query, the client just exited.
+ * Treat that as an "okay, end the session" answer.
+ *
+ * This call implicitly removes any inhibitors for the client, along
+ * with removing the client from the pending query list.
+ */
+ _handle_client_end_session_response (manager,
+ client,
+ TRUE,
+ FALSE,
+ FALSE,
+ "Client exited in "
+ "query end session phase "
+ "instead of end session "
+ "phase");
+ }
+
if (app == NULL) {
g_debug ("GsmManager: unable to find application for client - not restarting");
goto out;
@@ -2056,12 +2081,12 @@ out:
}
static void
-on_client_end_session_response (GsmClient *client,
- gboolean is_ok,
- gboolean do_last,
- gboolean cancel,
- const char *reason,
- GsmManager *manager)
+_handle_client_end_session_response (GsmManager *manager,
+ GsmClient *client,
+ gboolean is_ok,
+ gboolean do_last,
+ gboolean cancel,
+ const char *reason)
{
/* just ignore if received outside of shutdown */
if (manager->priv->phase < GSM_MANAGER_PHASE_QUERY_END_SESSION) {
@@ -2146,6 +2171,22 @@ on_client_end_session_response (GsmClient *client,
}
static void
+on_client_end_session_response (GsmClient *client,
+ gboolean is_ok,
+ gboolean do_last,
+ gboolean cancel,
+ const char *reason,
+ GsmManager *manager)
+{
+ _handle_client_end_session_response (manager,
+ client,
+ is_ok,
+ do_last,
+ cancel,
+ reason);
+}
+
+static void
on_xsmp_client_logout_request (GsmXSMPClient *client,
gboolean show_dialog,
GsmManager *manager)