2020-04-11 21:58:49 +00:00
|
|
|
This patch ensures '.desktop' files are picked up in the system profile
|
|
|
|
and not in the directories listed in $XDG_DATA_DIRS. The latter includes
|
|
|
|
'gnome-session.desktop', which should be used if it's in
|
|
|
|
/run/current-system/profile, and only then.
|
|
|
|
|
|
|
|
Fixes <https://bugs.gnu.org/37831>.
|
2021-09-26 09:02:12 +00:00
|
|
|
--- a/daemon/gdm-session.c 2021-07-23 15:16:15.164201000 +0000
|
|
|
|
+++ b/daemon/gdm-session.c 2021-09-26 08:18:58.730134555 +0000
|
2021-12-12 22:54:30 +00:00
|
|
|
@@ -354,25 +354,19 @@
|
2020-04-11 21:58:49 +00:00
|
|
|
GArray *search_array = NULL;
|
|
|
|
char **search_dirs;
|
|
|
|
int i;
|
|
|
|
- const gchar * const *system_data_dirs = g_get_system_data_dirs ();
|
|
|
|
|
|
|
|
static const char *x_search_dirs[] = {
|
|
|
|
"/etc/X11/sessions/",
|
|
|
|
DMCONFDIR "/Sessions/",
|
|
|
|
DATADIR "/gdm/BuiltInSessions/",
|
|
|
|
- DATADIR "/xsessions/",
|
2021-09-26 09:02:12 +00:00
|
|
|
+ "/run/current-system/profile/share/xsessions/",
|
2020-04-11 21:58:49 +00:00
|
|
|
};
|
|
|
|
|
2021-12-12 22:54:30 +00:00
|
|
|
- static const char *wayland_search_dir = DATADIR "/wayland-sessions/";
|
|
|
|
+ static const char *wayland_search_dir = "/run/current-system/profile/share/wayland-sessions/";
|
|
|
|
|
2020-04-11 21:58:49 +00:00
|
|
|
search_array = g_array_new (TRUE, TRUE, sizeof (char *));
|
|
|
|
|
2021-09-26 09:02:12 +00:00
|
|
|
if (type == NULL || g_str_equal (type, "x11")) {
|
|
|
|
- for (i = 0; system_data_dirs[i]; i++) {
|
|
|
|
- gchar *dir = g_build_filename (system_data_dirs[i], "xsessions", NULL);
|
|
|
|
- g_array_append_val (search_array, dir);
|
|
|
|
- }
|
2020-04-11 21:58:49 +00:00
|
|
|
-
|
2021-09-26 09:02:12 +00:00
|
|
|
g_array_append_vals (search_array, x_search_dirs, G_N_ELEMENTS (x_search_dirs));
|
|
|
|
}
|
2020-04-11 21:58:49 +00:00
|
|
|
|
2021-09-26 09:02:12 +00:00
|
|
|
@@ -382,16 +376,7 @@
|
2020-04-11 21:58:49 +00:00
|
|
|
#ifdef ENABLE_USER_DISPLAY_SERVER
|
|
|
|
g_array_prepend_val (search_array, wayland_search_dir);
|
|
|
|
|
|
|
|
- for (i = 0; system_data_dirs[i]; i++) {
|
|
|
|
- gchar *dir = g_build_filename (system_data_dirs[i], "wayland-sessions", NULL);
|
|
|
|
- g_array_insert_val (search_array, i, dir);
|
|
|
|
- }
|
|
|
|
#else
|
|
|
|
- for (i = 0; system_data_dirs[i]; i++) {
|
|
|
|
- gchar *dir = g_build_filename (system_data_dirs[i], "wayland-sessions", NULL);
|
|
|
|
- g_array_append_val (search_array, dir);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
g_array_append_val (search_array, wayland_search_dir);
|
|
|
|
#endif
|
|
|
|
}
|
2020-04-18 22:34:51 +00:00
|
|
|
diff -ur a/libgdm/gdm-sessions.c b/libgdm/gdm-sessions.c
|
|
|
|
--- a/libgdm/gdm-sessions.c 2019-10-07 04:53:35.000000000 -0400
|
|
|
|
+++ b/libgdm/gdm-sessions.c 2020-04-18 18:31:42.491348691 -0400
|
2021-12-12 22:54:30 +00:00
|
|
|
@@ -245,35 +245,23 @@
|
2020-04-11 21:58:49 +00:00
|
|
|
"/etc/X11/sessions/",
|
|
|
|
DMCONFDIR "/Sessions/",
|
|
|
|
DATADIR "/gdm/BuiltInSessions/",
|
|
|
|
- DATADIR "/xsessions/",
|
|
|
|
+ "/run/current-system/profile/share/xsessions/"
|
|
|
|
};
|
|
|
|
|
2020-04-18 22:34:51 +00:00
|
|
|
names_seen_before = g_hash_table_new (g_str_hash, g_str_equal);
|
|
|
|
xorg_search_array = g_ptr_array_new_with_free_func (g_free);
|
2020-04-11 21:58:49 +00:00
|
|
|
|
|
|
|
- const gchar * const *system_data_dirs = g_get_system_data_dirs ();
|
|
|
|
-
|
|
|
|
- for (i = 0; system_data_dirs[i]; i++) {
|
|
|
|
- session_dir = g_build_filename (system_data_dirs[i], "xsessions", NULL);
|
2020-04-18 22:34:51 +00:00
|
|
|
- g_ptr_array_add (xorg_search_array, session_dir);
|
2020-04-11 21:58:49 +00:00
|
|
|
- }
|
|
|
|
-
|
2020-04-18 22:34:51 +00:00
|
|
|
for (i = 0; i < G_N_ELEMENTS (xorg_search_dirs); i++) {
|
|
|
|
g_ptr_array_add (xorg_search_array, g_strdup (xorg_search_dirs[i]));
|
|
|
|
}
|
2021-12-12 22:54:30 +00:00
|
|
|
|
|
|
|
#ifdef ENABLE_WAYLAND_SUPPORT
|
|
|
|
const char *wayland_search_dirs[] = {
|
|
|
|
- DATADIR "/wayland-sessions/",
|
|
|
|
+ "/run/current-system/profile/share/wayland-sessions/",
|
|
|
|
};
|
2020-04-11 21:58:49 +00:00
|
|
|
|
2020-04-18 22:34:51 +00:00
|
|
|
wayland_search_array = g_ptr_array_new_with_free_func (g_free);
|
2020-04-11 21:58:49 +00:00
|
|
|
|
|
|
|
- for (i = 0; system_data_dirs[i]; i++) {
|
|
|
|
- session_dir = g_build_filename (system_data_dirs[i], "wayland-sessions", NULL);
|
2020-04-18 22:34:51 +00:00
|
|
|
- g_ptr_array_add (wayland_search_array, session_dir);
|
2020-04-11 21:58:49 +00:00
|
|
|
- }
|
|
|
|
-
|
2020-04-18 22:34:51 +00:00
|
|
|
for (i = 0; i < G_N_ELEMENTS (wayland_search_dirs); i++) {
|
|
|
|
g_ptr_array_add (wayland_search_array, g_strdup (wayland_search_dirs[i]));
|
|
|
|
}
|