mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-04 21:03:15 +00:00
145 lines
4.8 KiB
Diff
145 lines
4.8 KiB
Diff
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)
|
|
}
|
|
|
|
/**
|
|
+ * 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
|
|
*
|
|
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);
|
|
|
|
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);
|
|
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
|
|
@@ -12,6 +12,7 @@
|
|
#define LIGHTDM_SESSION_H_
|
|
|
|
#include <glib-object.h>
|
|
+#include "greeter.h"
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
@@ -42,9 +43,9 @@ typedef struct
|
|
|
|
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);
|
|
|
|
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
|
|
@@ -11,6 +11,7 @@
|
|
#include <string.h>
|
|
#include <gio/gdesktopappinfo.h>
|
|
|
|
+#include "lightdm/greeter.h"
|
|
#include "lightdm/session.h"
|
|
|
|
enum {
|
|
@@ -189,7 +190,7 @@ load_sessions (const gchar *sessions_dir)
|
|
}
|
|
|
|
static void
|
|
-update_sessions (void)
|
|
+update_sessions (LightDMGreeter *greeter)
|
|
{
|
|
GKeyFile *config_key_file = NULL;
|
|
gchar *config_path = NULL;
|
|
@@ -205,8 +206,7 @@ update_sessions (void)
|
|
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);
|
|
if (error && !g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT))
|
|
@@ -250,9 +250,9 @@ update_sessions (void)
|
|
* 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;
|
|
}
|
|
|
|
@@ -264,9 +264,9 @@ lightdm_get_sessions (void)
|
|
* 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;
|
|
}
|
|
|
|
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);
|
|
+
|
|
+ config_set_string (config_get_instance (), "SeatDefaults", "config-path", config_path);
|
|
+
|
|
g_free (config_path);
|
|
|
|
/* 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);
|
|
|