summaryrefslogtreecommitdiff
path: root/libgdm/gdm-sessions.c
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2015-06-15 15:03:51 -0400
committerRay Strode <rstrode@redhat.com>2015-11-06 22:19:37 -0500
commit754754c9b6f8da6066a37c47141c97da71d95e39 (patch)
tree24729d2eeb8834aff28540273daefd7ca5f406ba /libgdm/gdm-sessions.c
parent4b47633b36a22195e7976a8e597862eff695ca86 (diff)
downloadgdm-754754c9b6f8da6066a37c47141c97da71d95e39.tar.gz
libgdm: refactor session list handling code
This commit splits the code for getting sessions up into two chunks: xorg and wayland. This is necessary because future commits will treat xorg and wayland sessions differently. https://bugzilla.gnome.org/show_bug.cgi?id=757715
Diffstat (limited to 'libgdm/gdm-sessions.c')
-rw-r--r--libgdm/gdm-sessions.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/libgdm/gdm-sessions.c b/libgdm/gdm-sessions.c
index 08220fe0..db62516f 100644
--- a/libgdm/gdm-sessions.c
+++ b/libgdm/gdm-sessions.c
@@ -188,25 +188,35 @@ static void
collect_sessions (void)
{
int i;
- const char *search_dirs[] = {
+ const char *xorg_search_dirs[] = {
"/etc/X11/sessions/",
DMCONFDIR "/Sessions/",
DATADIR "/gdm/BuiltInSessions/",
DATADIR "/xsessions/",
+ NULL
+ };
+
#ifdef ENABLE_WAYLAND_SUPPORT
+ const char *wayland_search_dirs[] = {
DATADIR "/wayland-sessions/",
-#endif
NULL
};
+#endif
if (gdm_available_sessions_map == NULL) {
gdm_available_sessions_map = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, g_free);
}
- for (i = 0; search_dirs [i] != NULL; i++) {
- collect_sessions_from_directory (search_dirs [i]);
+ for (i = 0; xorg_search_dirs [i] != NULL; i++) {
+ collect_sessions_from_directory (xorg_search_dirs [i]);
}
+
+#ifdef ENABLE_WAYLAND_SUPPORT
+ for (i = 0; wayland_search_dirs [i] != NULL; i++) {
+ collect_sessions_from_directory (wayland_search_dirs [i]);
+ }
+#endif
}
/**