summaryrefslogtreecommitdiff
path: root/mate-session
diff options
context:
space:
mode:
authorinfirit <[email protected]>2015-01-13 14:11:10 +0100
committerinfirit <[email protected]>2015-01-13 14:11:10 +0100
commitfe9ef7eca1b83272408bc2d137cffa55512bea3e (patch)
tree76bf4d6cebac77b3eaf19aa08a39eda765185560 /mate-session
parent3037f574e89e3b34a075adf804c562b5963b73b7 (diff)
downloadmate-session-manager-fe9ef7eca1b83272408bc2d137cffa55512bea3e.tar.bz2
mate-session-manager-fe9ef7eca1b83272408bc2d137cffa55512bea3e.tar.xz
MsmGnome: Allow users to disable compatibility options
For example users may want to use a different ssh agent. Debian bug:https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=775189msmgnome: Allow users to disable one or both compatibility options
Diffstat (limited to 'mate-session')
-rw-r--r--mate-session/msm-gnome.c41
1 files changed, 36 insertions, 5 deletions
diff --git a/mate-session/msm-gnome.c b/mate-session/msm-gnome.c
index f92c45e..519d6a7 100644
--- a/mate-session/msm-gnome.c
+++ b/mate-session/msm-gnome.c
@@ -37,9 +37,13 @@
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
+#include <gio/gio.h>
#include "msm-gnome.h"
+#define GSM_SCHEMA "org.mate.session"
+#define GSM_GNOME_COMPAT_STARTUP_KEY "gnome-compat-startup"
+
#define GNOME_KEYRING_DAEMON "gnome-keyring-daemon"
@@ -222,16 +226,43 @@ msm_compat_gnome_smproxy_shutdown (void)
void
msm_gnome_start (void)
{
+ GSettings* settings;
+ gchar **array;
+ GList *startup = NULL;
+ gint i;
+
if (gnome_compat_started == TRUE)
return;
- g_debug ("MsmGnome: starting");
-
- msm_compat_gnome_smproxy_startup ();
+ settings = g_settings_new (GSM_SCHEMA);
+ array = g_settings_get_strv (settings, GSM_GNOME_COMPAT_STARTUP_KEY);
+ if (array) {
+ for (i = 0; array[i]; i++) {
+ startup = g_list_append (startup, g_strdup (array[i]));
+ }
+ }
+ g_strfreev (array);
+ g_object_unref (settings);
+
+ if (startup != NULL) {
+ if (g_list_find_custom (startup, "smproxy", (GCompareFunc) strcmp) != NULL) {
+ g_debug ("MsmGnome: starting smproxy");
+ msm_compat_gnome_smproxy_startup ();
+ gnome_compat_started = TRUE;
+ } else if (g_list_find_custom (startup, "keyring", (GCompareFunc) strcmp) != NULL) {
+ g_debug ("MsmGnome: starting keyring");
+ gnome_keyring_daemon_startup ();
+ gnome_compat_started = TRUE;
+ } else {
+ g_debug ("MsmGnome: unknown component, ignoring");
+ }
- gnome_keyring_daemon_startup ();
+ g_list_foreach (startup, (GFunc) g_free, NULL);
+ g_list_free (startup);
- gnome_compat_started = TRUE;
+ } else {
+ g_debug ("MsmGnome: No components found to start");
+ }
}