gdm

Merge lp:~osomon/gdm/fix-1718446 into lp:~ubuntu-desktop/gdm/ubuntu

Proposed by Olivier Tilloy
Status: Merged
Merged at revision: 444
Proposed branch: lp:~osomon/gdm/fix-1718446
Merge into: lp:~ubuntu-desktop/gdm/ubuntu
Diff against target: 74 lines (+54/-0)
3 files modified
debian/changelog (+9/-0)
debian/patches/series (+1/-0)
debian/patches/ubuntu_ignore_sessions_xorg_suffix.patch (+44/-0)
To merge this branch: bzr merge lp:~osomon/gdm/fix-1718446
Reviewer Review Type Date Requested Status
Sebastien Bacher Approve
Didier Roche-Tolomelli Approve
Review via email: mp+332145@code.launchpad.net

Commit message

Ignore session IDs ending with "-xorg" under X11.
In combination with a gnome-session patch, this ensures a proper fallback session is selected by gdm when wayland is not enabled.

Description of the change

Note: this branch and https://code.launchpad.net/~osomon/gnome-session/fix-1718446/+merge/332146 need to be released together for the fix to be complete.

To post a comment you must log in.
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

The code looks good to me, didn't spot anything, even if we don't have the gnome-session changesinstalled. Thanks for the extensive testing!

review: Approve
lp:~osomon/gdm/fix-1718446 updated
445. By Olivier Tilloy

Add missing whitespace, per upstream review.

Revision history for this message
Sebastien Bacher (seb128) wrote :

looks good, merging & uploading

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2017-10-11 11:20:42 +0000
+++ debian/changelog 2017-10-17 16:29:28 +0000
@@ -1,3 +1,12 @@
1gdm3 (3.26.1-3ubuntu3) UNRELEASED; urgency=medium
2
3 * debian/patches/ubuntu_ignore_sessions_xorg_suffix.patch: Ignore session
4 IDs ending with "-xorg" under X11. In combination with a gnome-session
5 patch, this ensures a proper fallback session is selected by gdm when
6 wayland is not enabled (LP: #1718446).
7
8 -- Olivier Tilloy <olivier.tilloy@canonical.com> Wed, 11 Oct 2017 18:57:51 +0200
9
1gdm3 (3.26.1-3ubuntu2) artful; urgency=medium10gdm3 (3.26.1-3ubuntu2) artful; urgency=medium
211
3 * debian/patches/ubuntu_dont_set_language_env.patch:12 * debian/patches/ubuntu_dont_set_language_env.patch:
413
=== modified file 'debian/patches/series'
--- debian/patches/series 2017-10-09 22:22:46 +0000
+++ debian/patches/series 2017-10-17 16:29:28 +0000
@@ -10,3 +10,4 @@
10revert_override_LANG_with_accountservices.patch10revert_override_LANG_with_accountservices.patch
11ubuntu_config_error_dialog.patch11ubuntu_config_error_dialog.patch
12ubuntu_dont_set_language_env.patch12ubuntu_dont_set_language_env.patch
13ubuntu_ignore_sessions_xorg_suffix.patch
1314
=== added file 'debian/patches/ubuntu_ignore_sessions_xorg_suffix.patch'
--- debian/patches/ubuntu_ignore_sessions_xorg_suffix.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/ubuntu_ignore_sessions_xorg_suffix.patch 2017-10-17 16:29:28 +0000
@@ -0,0 +1,44 @@
1Author: Olivier Tilloy <olivier.tilloy@canonical.com>
2Description: Ignore session IDs ending with "-xorg" under X11
3 This is done under the assumption that they are meant for Wayland only.
4 It is expected that a session called "foo" would have a "foo.desktop" file
5 under wayland-sessions/, a fallback "foo.desktop" under xsessions/, and
6 another "foo-xorg.desktop" under xsessions (that may simply be a symlink
7 to "foo.desktop") specifically for Wayland.
8Bug: https://bugzilla.gnome.org/show_bug.cgi?id=788552
9Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gdm3/+bug/1718446
10
11--- a/libgdm/gdm-sessions.c
12+++ b/libgdm/gdm-sessions.c
13@@ -157,6 +157,9 @@ collect_sessions_from_directory (const c
14 GDir *dir;
15 const char *filename;
16
17+ gboolean is_x11 = g_getenv ("WAYLAND_DISPLAY") == NULL &&
18+ g_getenv ("RUNNING_UNDER_GDM") != NULL;
19+
20 /* FIXME: add file monitor to directory */
21
22 dir = g_dir_open (dirname, 0, NULL);
23@@ -171,6 +174,21 @@ collect_sessions_from_directory (const c
24 if (! g_str_has_suffix (filename, ".desktop")) {
25 continue;
26 }
27+
28+ if (is_x11 && g_str_has_suffix (filename, "-xorg.desktop")) {
29+ char *base_name = g_strndup (filename, strlen (filename) - strlen ("-xorg.desktop"));
30+ char *fallback_name = g_strconcat (base_name, ".desktop", NULL);
31+ g_free (base_name);
32+ char *fallback_path = g_build_filename (dirname, fallback_name, NULL);
33+ g_free (fallback_name);
34+ if (g_file_test (fallback_path, G_FILE_TEST_EXISTS)) {
35+ g_free (fallback_path);
36+ g_debug ("Running under X11, ignoring %s", filename);
37+ continue;
38+ }
39+ g_free (fallback_path);
40+ }
41+
42 id = g_strndup (filename, strlen (filename) - strlen (".desktop"));
43
44 full_path = g_build_filename (dirname, filename, NULL);

Subscribers

People subscribed via source and target branches

to all changes: