gdm

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

Proposed by Olivier Tilloy on 2017-10-11
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 on 2017-10-18
Didier Roche 2017-10-11 Approve on 2017-10-13
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.
Didier Roche (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 on 2017-10-17
445. By Olivier Tilloy on 2017-10-17

Add missing whitespace, per upstream review.

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

Subscribers

People subscribed via source and target branches

to all changes: