summary refs log tree commit diff
path: root/pkgs/applications/display-managers/lightdm/lightdm.patch
blob: a6e53bafcc79032d04959ce8c9c730c2a9b93afb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
=== modified file 'liblightdm-gobject/greeter.c'
--- liblightdm-gobject/greeter.c	2013-01-31 20:56:09 +0000
+++ liblightdm-gobject/greeter.c	2013-03-29 14:15:58 +0000
@@ -567,6 +567,21 @@
 }
 
 /**
+ * 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
  *

=== modified file 'liblightdm-gobject/lightdm/greeter.h'
--- liblightdm-gobject/lightdm/greeter.h	2013-01-31 20:56:09 +0000
+++ liblightdm-gobject/lightdm/greeter.h	2013-03-29 11:56:11 +0000
@@ -93,6 +93,8 @@
 
 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);

=== modified file 'liblightdm-gobject/lightdm/session.h'
--- liblightdm-gobject/lightdm/session.h	2013-01-31 20:56:09 +0000
+++ liblightdm-gobject/lightdm/session.h	2013-03-29 11:59:16 +0000
@@ -12,6 +12,7 @@
 #define _LIGHTDM_SESSION_H_
 
 #include <glib-object.h>
+#include "greeter.h"
 
 G_BEGIN_DECLS
 
@@ -42,9 +43,9 @@
 
 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);
 

=== modified file 'liblightdm-gobject/session.c'
--- liblightdm-gobject/session.c	2013-01-31 20:56:09 +0000
+++ liblightdm-gobject/session.c	2013-03-29 14:16:48 +0000
@@ -11,6 +11,7 @@
 #include <string.h>
 #include <gio/gdesktopappinfo.h>
 
+#include "lightdm/greeter.h"
 #include "lightdm/session.h"
 
 enum {
@@ -167,7 +168,7 @@
 }
 
 static void
-update_sessions (void)
+update_sessions (LightDMGreeter *greeter)
 {
     GKeyFile *config_key_file = NULL;
     gchar *config_path = NULL;
@@ -183,8 +184,8 @@
     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)
@@ -228,9 +229,9 @@
  * 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;
 }
 
@@ -242,9 +243,9 @@
  * 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;
 }
 

=== modified file 'src/display.c'
--- src/display.c	2013-03-26 22:22:49 +0000
+++ src/display.c	2013-03-29 12:12:43 +0000
@@ -62,6 +62,9 @@
     /* Program to run sessions through */
     gchar *session_wrapper;
 
+    /* Path to the configuration file that lightdm is running under */
+    gchar *config_path;
+
     /* TRUE if in a user session */
     gboolean in_user_session;
 
@@ -213,6 +216,14 @@
 }
 
 void
+display_set_config_path (Display *display, const gchar *config_path)
+{
+    g_return_if_fail (display != NULL);
+    g_free (display->priv->config_path);
+    display->priv->config_path = g_strdup (config_path);
+}
+
+void
 display_set_show_remote_login_hint (Display *display, gboolean show_remote_login)
 {
     g_return_if_fail (display != NULL);
@@ -436,6 +447,7 @@
     greeter_set_hint (display->priv->greeter, "show-remote-login", display->priv->greeter_show_remote_login ? "true" : "false");
     if (display->priv->greeter_is_lock)
         greeter_set_hint (display->priv->greeter, "lock-screen", "true");
+    greeter_set_hint (display->priv->greeter, "config-path", display->priv->config_path);
 
     /* Run greeter as unprivileged user */
     if (getuid () != 0)

=== modified file 'src/display.h'
--- src/display.h	2013-03-26 22:22:49 +0000
+++ src/display.h	2013-03-29 12:12:37 +0000
@@ -80,6 +80,8 @@
 
 void display_set_user_session (Display *display, SessionType type, const gchar *session_name);
 
+void display_set_config_path (Display *display, const gchar *config_path);
+
 gboolean display_start (Display *display);
 
 gboolean display_get_is_ready (Display *display);

=== modified file 'src/lightdm.c'
--- src/lightdm.c	2013-03-07 21:40:31 +0000
+++ src/lightdm.c	2013-03-29 11:48:45 +0000
@@ -1050,6 +1050,7 @@
     g_debug ("Starting Light Display Manager %s, UID=%i PID=%i", VERSION, getuid (), getpid ());
 
     g_debug ("Loaded configuration from %s", config_path);
+    config_set_string (config_get_instance (), "LightDM", "config-path", config_path);
     g_free (config_path);
 
     g_debug ("Using D-Bus name %s", LIGHTDM_BUS_NAME);

=== modified file 'src/seat.c'
--- src/seat.c	2013-03-26 22:22:49 +0000
+++ src/seat.c	2013-03-29 12:13:00 +0000
@@ -536,6 +536,7 @@
     if (!session_name)
         session_name = seat_get_string_property (seat, "user-session");
     display_set_user_session (display, SESSION_TYPE_LOCAL, session_name);
+    display_set_config_path (display, config_get_string (config_get_instance (), "LightDM", "config-path"));
 
     seat->priv->displays = g_list_append (seat->priv->displays, display);
     g_signal_emit (seat, signals[DISPLAY_ADDED], 0, display);