diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2017-06-09 09:53:13 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2017-06-09 14:51:58 +0200 |
commit | 938988360da9c79a1c2904bca1249c16a59cfe3f (patch) | |
tree | 56862ce87c8a635dbe7cb13cd6decef16c48b934 /src/backend-dbus/actions.c | |
parent | 8ba52cade7ebf260095c980a580b7c37d67818f9 (diff) | |
download | ayatana-indicator-session-938988360da9c79a1c2904bca1249c16a59cfe3f.tar.gz ayatana-indicator-session-938988360da9c79a1c2904bca1249c16a59cfe3f.tar.bz2 ayatana-indicator-session-938988360da9c79a1c2904bca1249c16a59cfe3f.zip |
DBus actions: Add support for logging out via GNOME/MATE session manager.
Diffstat (limited to 'src/backend-dbus/actions.c')
-rw-r--r-- | src/backend-dbus/actions.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/backend-dbus/actions.c b/src/backend-dbus/actions.c index d1508f4..41e7056 100644 --- a/src/backend-dbus/actions.c +++ b/src/backend-dbus/actions.c @@ -92,6 +92,7 @@ typedef enum { PROMPT_NONE, PROMPT_WITH_ZENITY, + PROMPT_WITH_GNOME_SESSION_MANAGER, PROMPT_WITH_AYATANA } prompt_status_t; @@ -114,6 +115,16 @@ get_prompt_status (IndicatorSessionActionsDbus * self) g_free (name); } + /* can we use the GNOME's/MATE's session manager prompt? */ + if ((prompt == PROMPT_NONE) && p && p->session_manager) + { + GDBusProxy * proxy = G_DBUS_PROXY (p->session_manager); + char * name = g_dbus_proxy_get_name_owner (proxy); + if (name != NULL) + prompt = PROMPT_WITH_GNOME_SESSION_MANAGER;; + g_free (name); + } + /* can we use zenity? */ if ((prompt == PROMPT_NONE) && p && p->zenity) prompt = PROMPT_WITH_ZENITY; @@ -776,6 +787,10 @@ my_logout (IndicatorSessionActions * actions) show_desktop_end_session_dialog (self, END_SESSION_TYPE_LOGOUT); break; + case PROMPT_WITH_GNOME_SESSION_MANAGER: + logout_now_gnome_session_manager (self); + break; + case PROMPT_NONE: logout_now (self); break; |