summaryrefslogtreecommitdiff
path: root/mate-session/gsm-manager.c
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-11-04 18:50:08 +0100
committerinfirit <[email protected]>2014-11-04 18:50:08 +0100
commit778ae13f16b024d230c6954548505757b52d0e2b (patch)
tree3264ecb585320440e50f934e71ad9d17e2232300 /mate-session/gsm-manager.c
parent0b67ce2c762b1aabf12d3f4a80a5c902add5658c (diff)
downloadmate-session-manager-778ae13f16b024d230c6954548505757b52d0e2b.tar.bz2
mate-session-manager-778ae13f16b024d230c6954548505757b52d0e2b.tar.xz
manager: don't ever show inhibitor dialog if logout is forced
If logout is forced, we don't want to show the inhibitor dialog. A forced logout is one that shouldn't be "cancelable". This commit prevents inhibitors from getting added if logout is forced. Based on gnome-session commit: bf1b6e8843b5e72d4f5a62a34eb322b82e33c2df From: Ray Strode <[email protected]>
Diffstat (limited to 'mate-session/gsm-manager.c')
-rw-r--r--mate-session/gsm-manager.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/mate-session/gsm-manager.c b/mate-session/gsm-manager.c
index 01ebac4..2af0902 100644
--- a/mate-session/gsm-manager.c
+++ b/mate-session/gsm-manager.c
@@ -1394,6 +1394,12 @@ _on_query_end_session_timeout (GsmManager *manager)
g_warning ("Client '%s' failed to reply before timeout",
gsm_client_peek_id (l->data));
+ /* Don't add "not responding" inhibitors if logout is forced
+ */
+ if (manager->priv->forceful_logout) {
+ continue;
+ }
+
/* Add JIT inhibit for unresponsive client */
if (GSM_IS_DBUS_CLIENT (l->data)) {
bus_name = gsm_dbus_client_get_bus_name (l->data);
@@ -1449,8 +1455,8 @@ do_phase_query_end_session (GsmManager *manager)
(GsmStoreFunc)_client_query_end_session,
&data);
- /* This phase doesn't time out. This separate timer is only used to
- * show UI. */
+ /* This phase doesn't time out unless logout is forced. Typically, this
+ * separate timer is only used to show UI. */
manager->priv->query_timeout_id = g_timeout_add_seconds (1, (GSourceFunc)_on_query_end_session_timeout, manager);
}
@@ -2102,7 +2108,7 @@ _handle_client_end_session_response (GsmManager *manager,
manager->priv->query_clients = g_slist_remove (manager->priv->query_clients, client);
- if (! is_ok) {
+ if (! is_ok && !manager->priv->forceful_logout) {
guint cookie;
GsmInhibitor *inhibitor;
char *app_id;
@@ -3546,6 +3552,18 @@ gsm_manager_inhibit (GsmManager *manager,
reason,
flags);
+ if (manager->priv->forceful_logout) {
+ GError *new_error;
+
+ new_error = g_error_new (GSM_MANAGER_ERROR,
+ GSM_MANAGER_ERROR_GENERAL,
+ "Forced logout cannot be inhibited");
+ g_debug ("GsmManager: Unable to inhibit: %s", new_error->message);
+ dbus_g_method_return_error (context, new_error);
+ g_error_free (new_error);
+ return FALSE;
+ }
+
if (IS_STRING_EMPTY (app_id)) {
GError *new_error;