| 1 | This patch ensures '.desktop' files are picked up in the system profile
|
| 2 | and not in the directories listed in $XDG_DATA_DIRS. The latter includes
|
| 3 | 'gnome-session.desktop', which should be used if it's in
|
| 4 | /run/current-system/profile, and only then.
|
| 5 |
|
| 6 | Fixes <https://bugs.gnu.org/37831>.
|
| 7 | diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
|
| 8 | index 644aad022..d54406e93 100644
|
| 9 | |
| 10 | |
| 11 | @@ -378,16 +378,15 @@ get_system_session_dirs (GdmSession *self,
|
| 12 | GArray *search_array = NULL;
|
| 13 | char **search_dirs;
|
| 14 | int i, j;
|
| 15 | - const gchar * const *system_data_dirs = g_get_system_data_dirs ();
|
| 16 |
|
| 17 | static const char *x_search_dirs[] = {
|
| 18 | "/etc/X11/sessions/",
|
| 19 | DMCONFDIR "/Sessions/",
|
| 20 | DATADIR "/gdm/BuiltInSessions/",
|
| 21 | - DATADIR "/xsessions/",
|
| 22 | + "/run/current-system/profile/share/xsessions/",
|
| 23 | };
|
| 24 |
|
| 25 | - static const char *wayland_search_dir = DATADIR "/wayland-sessions/";
|
| 26 | + static const char *wayland_search_dir = "/run/current-system/profile/share/wayland-sessions/";
|
| 27 |
|
| 28 | search_array = g_array_new (TRUE, TRUE, sizeof (char *));
|
| 29 |
|
| 30 | @@ -396,11 +395,6 @@ get_system_session_dirs (GdmSession *self,
|
| 31 |
|
| 32 | if (g_str_equal (supported_type, "x11") &&
|
| 33 | (type == NULL || g_str_equal (type, supported_type))) {
|
| 34 | - for (i = 0; system_data_dirs[i]; i++) {
|
| 35 | - gchar *dir = g_build_filename (system_data_dirs[i], "xsessions", NULL);
|
| 36 | - g_array_append_val (search_array, dir);
|
| 37 | - }
|
| 38 | -
|
| 39 | g_array_append_vals (search_array, x_search_dirs, G_N_ELEMENTS (x_search_dirs));
|
| 40 | }
|
| 41 |
|
| 42 | @@ -408,11 +402,6 @@ get_system_session_dirs (GdmSession *self,
|
| 43 | #ifdef ENABLE_WAYLAND_SUPPORT
|
| 44 | if (g_str_equal (supported_type, "wayland") &&
|
| 45 | (type == NULL || g_str_equal (type, supported_type))) {
|
| 46 | - for (i = 0; system_data_dirs[i]; i++) {
|
| 47 | - gchar *dir = g_build_filename (system_data_dirs[i], "wayland-sessions", NULL);
|
| 48 | - g_array_append_val (search_array, dir);
|
| 49 | - }
|
| 50 | -
|
| 51 | g_array_append_val (search_array, wayland_search_dir);
|
| 52 | }
|
| 53 | #endif
|
| 54 | diff --git a/libgdm/gdm-sessions.c b/libgdm/gdm-sessions.c
|
| 55 | index df8e377b7..e80acf7e4 100644
|
| 56 | |
| 57 | |
| 58 | @@ -347,27 +347,21 @@ collect_sessions (void)
|
| 59 | "/etc/X11/sessions/",
|
| 60 | DMCONFDIR "/Sessions/",
|
| 61 | DATADIR "/gdm/BuiltInSessions/",
|
| 62 | + "/run/current-system/profile/share/xsessions/",
|
| 63 | };
|
| 64 |
|
| 65 | if (!supported_session_types || g_strv_contains ((const char * const *) supported_session_types, "x11")) {
|
| 66 | for (i = 0; i < G_N_ELEMENTS (xorg_search_dirs); i++) {
|
| 67 | g_ptr_array_add (dirs_search_array, g_strdup (xorg_search_dirs[i]));
|
| 68 | }
|
| 69 | -
|
| 70 | - for (i = 0; system_data_dirs[i]; i++) {
|
| 71 | - session_dir = g_build_filename (system_data_dirs[i], "xsessions", NULL);
|
| 72 | - g_ptr_array_add (dirs_search_array, session_dir);
|
| 73 | - }
|
| 74 | }
|
| 75 | #endif
|
| 76 |
|
| 77 | #ifdef ENABLE_WAYLAND_SUPPORT
|
| 78 | #ifdef ENABLE_USER_DISPLAY_SERVER
|
| 79 | if (!supported_session_types || g_strv_contains ((const char * const *) supported_session_types, "wayland")) {
|
| 80 | - for (i = 0; system_data_dirs[i]; i++) {
|
| 81 | - session_dir = g_build_filename (system_data_dirs[i], "wayland-sessions", NULL);
|
| 82 | - g_ptr_array_add (dirs_search_array, session_dir);
|
| 83 | - }
|
| 84 | + g_ptr_array_add (dirs_search_array,
|
| 85 | + g_strdup ("/run/current-system/profile/share/wayland-sessions/"));
|
| 86 | }
|
| 87 | #endif
|
| 88 | #endif
|