2014-01-31 12:11:04 +01:00
|
|
|
diff --git a/liblightdm-gobject/greeter.c b/liblightdm-gobject/greeter.c
|
|
|
|
index 9387118..635cea0 100644
|
|
|
|
--- a/liblightdm-gobject/greeter.c
|
|
|
|
+++ b/liblightdm-gobject/greeter.c
|
|
|
|
@@ -567,6 +567,21 @@ lightdm_greeter_get_default_session_hint (LightDMGreeter *greeter)
|
2013-03-26 11:42:18 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
+ * lightdm_greeter_get_config_path
|
|
|
|
+ * @greeter: A #LightDMGreeter
|
|
|
|
+ *
|
|
|
|
+ * Get the config path to LightDM.
|
|
|
|
+ *
|
|
|
|
+ * Return value: The path to the current LightDM configuration file.
|
|
|
|
+ **/
|
|
|
|
+const gchar *
|
|
|
|
+lightdm_greeter_get_config_path (LightDMGreeter *greeter)
|
|
|
|
+{
|
|
|
|
+ g_return_val_if_fail (LIGHTDM_IS_GREETER (greeter), NULL);
|
|
|
|
+ return lightdm_greeter_get_hint (greeter, "config-path");
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
* lightdm_greeter_get_hide_users_hint:
|
|
|
|
* @greeter: A #LightDMGreeter
|
|
|
|
*
|
2014-01-31 12:11:04 +01:00
|
|
|
diff --git a/liblightdm-gobject/lightdm/greeter.h b/liblightdm-gobject/lightdm/greeter.h
|
|
|
|
index 7d8988f..2b54909 100644
|
|
|
|
--- a/liblightdm-gobject/lightdm/greeter.h
|
|
|
|
+++ b/liblightdm-gobject/lightdm/greeter.h
|
|
|
|
@@ -93,6 +93,8 @@ gboolean lightdm_greeter_get_select_guest_hint (LightDMGreeter *greeter);
|
2013-03-26 11:42:18 +01:00
|
|
|
|
|
|
|
const gchar *lightdm_greeter_get_autologin_user_hint (LightDMGreeter *greeter);
|
|
|
|
|
|
|
|
+const gchar *lightdm_greeter_get_config_path (LightDMGreeter *greeter);
|
|
|
|
+
|
|
|
|
gboolean lightdm_greeter_get_autologin_guest_hint (LightDMGreeter *greeter);
|
|
|
|
|
|
|
|
gint lightdm_greeter_get_autologin_timeout_hint (LightDMGreeter *greeter);
|
2014-01-31 12:11:04 +01:00
|
|
|
diff --git a/liblightdm-gobject/lightdm/session.h b/liblightdm-gobject/lightdm/session.h
|
|
|
|
index 13ddcd9..cdb2fd6 100644
|
|
|
|
--- a/liblightdm-gobject/lightdm/session.h
|
|
|
|
+++ b/liblightdm-gobject/lightdm/session.h
|
2013-03-26 11:42:18 +01:00
|
|
|
@@ -12,6 +12,7 @@
|
2014-01-31 12:11:04 +01:00
|
|
|
#define LIGHTDM_SESSION_H_
|
2013-03-26 11:42:18 +01:00
|
|
|
|
|
|
|
#include <glib-object.h>
|
|
|
|
+#include "greeter.h"
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2014-01-31 12:11:04 +01:00
|
|
|
@@ -42,9 +43,9 @@ typedef struct
|
2013-03-26 11:42:18 +01:00
|
|
|
|
|
|
|
GType lightdm_session_get_type (void);
|
|
|
|
|
|
|
|
-GList *lightdm_get_sessions (void);
|
|
|
|
+GList *lightdm_get_sessions (LightDMGreeter *greeter);
|
|
|
|
|
|
|
|
-GList *lightdm_get_remote_sessions (void);
|
|
|
|
+GList *lightdm_get_remote_sessions (LightDMGreeter *greeter);
|
|
|
|
|
|
|
|
const gchar *lightdm_session_get_key (LightDMSession *session);
|
|
|
|
|
2014-01-31 12:11:04 +01:00
|
|
|
diff --git a/liblightdm-gobject/session.c b/liblightdm-gobject/session.c
|
|
|
|
index 949778f..db5e18a 100644
|
|
|
|
--- a/liblightdm-gobject/session.c
|
|
|
|
+++ b/liblightdm-gobject/session.c
|
2013-03-26 11:42:18 +01:00
|
|
|
@@ -11,6 +11,7 @@
|
|
|
|
#include <string.h>
|
|
|
|
#include <gio/gdesktopappinfo.h>
|
|
|
|
|
|
|
|
+#include "lightdm/greeter.h"
|
|
|
|
#include "lightdm/session.h"
|
|
|
|
|
|
|
|
enum {
|
2014-01-31 12:11:04 +01:00
|
|
|
@@ -189,7 +190,7 @@ load_sessions (const gchar *sessions_dir)
|
2013-03-26 11:42:18 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
-update_sessions (void)
|
|
|
|
+update_sessions (LightDMGreeter *greeter)
|
|
|
|
{
|
|
|
|
GKeyFile *config_key_file = NULL;
|
|
|
|
gchar *config_path = NULL;
|
2014-01-31 12:11:04 +01:00
|
|
|
@@ -205,8 +206,7 @@ update_sessions (void)
|
2013-03-26 11:42:18 +01:00
|
|
|
remote_sessions_dir = g_strdup (REMOTE_SESSIONS_DIR);
|
|
|
|
|
|
|
|
/* Use session directory from configuration */
|
|
|
|
- /* FIXME: This should be sent in the greeter connection */
|
|
|
|
- config_path = g_build_filename (CONFIG_DIR, "lightdm.conf", NULL);
|
|
|
|
+ config_path = g_strdup (lightdm_greeter_get_config_path (greeter));
|
|
|
|
config_key_file = g_key_file_new ();
|
|
|
|
result = g_key_file_load_from_file (config_key_file, config_path, G_KEY_FILE_NONE, &error);
|
2014-01-31 12:11:04 +01:00
|
|
|
if (error && !g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT))
|
|
|
|
@@ -250,9 +250,9 @@ update_sessions (void)
|
2013-03-26 11:42:18 +01:00
|
|
|
* Return value: (element-type LightDMSession) (transfer none): A list of #LightDMSession
|
|
|
|
**/
|
|
|
|
GList *
|
|
|
|
-lightdm_get_sessions (void)
|
|
|
|
+lightdm_get_sessions (LightDMGreeter *greeter)
|
|
|
|
{
|
|
|
|
- update_sessions ();
|
|
|
|
+ update_sessions (greeter);
|
|
|
|
return local_sessions;
|
|
|
|
}
|
|
|
|
|
2014-01-31 12:11:04 +01:00
|
|
|
@@ -264,9 +264,9 @@ lightdm_get_sessions (void)
|
2013-03-26 11:42:18 +01:00
|
|
|
* Return value: (element-type LightDMSession) (transfer none): A list of #LightDMSession
|
|
|
|
**/
|
|
|
|
GList *
|
|
|
|
-lightdm_get_remote_sessions (void)
|
|
|
|
+lightdm_get_remote_sessions (LightDMGreeter *greeter)
|
|
|
|
{
|
|
|
|
- update_sessions ();
|
|
|
|
+ update_sessions (greeter);
|
|
|
|
return remote_sessions;
|
|
|
|
}
|
|
|
|
|
2014-01-31 12:11:04 +01:00
|
|
|
diff --git a/src/lightdm.c b/src/lightdm.c
|
|
|
|
index 7d35034..910164c 100644
|
|
|
|
--- a/src/lightdm.c
|
|
|
|
+++ b/src/lightdm.c
|
|
|
|
@@ -1142,6 +1142,9 @@ main (int argc, char **argv)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
g_clear_error (&error);
|
2013-03-26 11:42:18 +01:00
|
|
|
+
|
2014-01-31 12:11:04 +01:00
|
|
|
+ config_set_string (config_get_instance (), "SeatDefaults", "config-path", config_path);
|
2013-03-26 11:42:18 +01:00
|
|
|
+
|
|
|
|
g_free (config_path);
|
|
|
|
|
2014-01-31 12:11:04 +01:00
|
|
|
/* Set default values */
|
|
|
|
diff --git a/src/seat.c b/src/seat.c
|
|
|
|
index e2b9c2c..a950ea2 100644
|
|
|
|
--- a/src/seat.c
|
|
|
|
+++ b/src/seat.c
|
|
|
|
@@ -1137,6 +1137,7 @@ create_greeter_session (Seat *seat)
|
|
|
|
greeter_set_hint (greeter_session, "show-manual-login", seat_get_boolean_property (seat, "greeter-show-manual-login") ? "true" : "false");
|
|
|
|
greeter_set_hint (greeter_session, "show-remote-login", seat_get_boolean_property (seat, "greeter-show-remote-login") ? "true" : "false");
|
|
|
|
greeter_set_hint (greeter_session, "has-guest-account", seat_get_allow_guest (seat) && seat_get_boolean_property (seat, "greeter-allow-guest") ? "true" : "false");
|
|
|
|
+ greeter_set_hint (greeter_session, "config-path", seat_get_string_property (seat, "config-path"));
|
|
|
|
|
|
|
|
g_object_unref (session_config);
|
|
|
|
|