diff options
author | infirit <[email protected]> | 2014-11-07 12:42:20 +0100 |
---|---|---|
committer | infirit <[email protected]> | 2014-11-07 14:31:51 +0100 |
commit | ccfc0f67de5e6b15a1c7e33f45c671bc2cebd4b4 (patch) | |
tree | e7d38296e17df6433d8f43f1bb9108930b530f7d /mate-session | |
parent | f3df23785148cb606557e860cf13c93a16a17758 (diff) | |
download | mate-session-manager-ccfc0f67de5e6b15a1c7e33f45c671bc2cebd4b4.tar.bz2 mate-session-manager-ccfc0f67de5e6b15a1c7e33f45c671bc2cebd4b4.tar.xz |
gsm: Support disable-user-switching lockdown setting in logout dialog
Based on gnome-session commit:fa30b73948c50c2493e19565b4e3b14b40f985e1
From: Vincent Untz <[email protected]>
Diffstat (limited to 'mate-session')
-rw-r--r-- | mate-session/gsm-logout-dialog.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/mate-session/gsm-logout-dialog.c b/mate-session/gsm-logout-dialog.c index 8b48ced..cd03139 100644 --- a/mate-session/gsm-logout-dialog.c +++ b/mate-session/gsm-logout-dialog.c @@ -47,6 +47,9 @@ #define SESSION_SCHEMA "org.mate.session" #define KEY_LOGOUT_TIMEOUT "logout-timeout" +#define LOCKDOWN_SCHEMA "org.mate.lockdown" +#define KEY_USER_SWITCHING_DISABLE "disable-user-switching" + typedef enum { GSM_DIALOG_LOGOUT_TYPE_LOGOUT, GSM_DIALOG_LOGOUT_TYPE_SHUTDOWN @@ -242,14 +245,22 @@ gsm_logout_supports_system_hibernate (GsmLogoutDialog *logout_dialog) static gboolean gsm_logout_supports_switch_user (GsmLogoutDialog *logout_dialog) { - gboolean ret; + GSettings *settings; + gboolean ret; + + settings = g_settings_new (LOCKDOWN_SCHEMA); + if (g_settings_get_boolean (settings, KEY_USER_SWITCHING_DISABLE)) + ret = FALSE; + g_object_unref (settings); + + if (ret) #ifdef HAVE_SYSTEMD - if (LOGIND_RUNNING()) - ret = gsm_systemd_can_switch_user (logout_dialog->priv->systemd); - else + if (LOGIND_RUNNING()) + ret = gsm_systemd_can_switch_user (logout_dialog->priv->systemd); + else #endif - ret = gsm_consolekit_can_switch_user (logout_dialog->priv->consolekit); + ret = gsm_consolekit_can_switch_user (logout_dialog->priv->consolekit); return ret; } |