Merge lp:~robert-ancell/lightdm/xdg-current-desktop into lp:lightdm

Proposed by Robert Ancell
Status: Merged
Approved by: Michael Terry
Approved revision: 1753
Merged at revision: 1753
Proposed branch: lp:~robert-ancell/lightdm/xdg-current-desktop
Merge into: lp:lightdm
Diff against target: 176 lines (+59/-1)
8 files modified
src/seat.c (+4/-0)
src/session-config.c (+12/-0)
src/session-config.h (+2/-0)
tests/Makefile.am (+2/-0)
tests/data/sessions/named.desktop (+5/-0)
tests/scripts/xdg-current-desktop.conf (+28/-0)
tests/src/test-session.c (+4/-1)
tests/test-xdg-current-desktop (+2/-0)
To merge this branch: bzr merge lp:~robert-ancell/lightdm/xdg-current-desktop
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Michael Terry Approve
LightDM Development Team Pending
Review via email: mp+180756@code.launchpad.net

Commit message

Set $XDG_CURRENT_DESKTOP if specified in the xsession file

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:1753
http://jenkins.qa.ubuntu.com/job/lightdm-ci/161/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/lightdm-saucy-amd64-ci/77/console

Click here to trigger a rebuild:
http://s-jenkins:8080/job/lightdm-ci/161/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Terry (mterry) wrote :

Looks good to me!

review: Approve
Revision history for this message
Michael Terry (mterry) wrote :

Test seems like a jenkins issue. Will retry.

Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/seat.c'
2--- src/seat.c 2013-08-08 10:10:19 +0000
3+++ src/seat.c 2013-08-19 00:27:13 +0000
4@@ -774,12 +774,16 @@
5 g_free (sessions_dir);
6 if (session_config)
7 {
8+ const gchar *desktop_name;
9 gchar **argv;
10
11 session = create_session (seat, TRUE);
12 session_set_session_type (session, session_config_get_session_type (session_config));
13 session_set_env (session, "DESKTOP_SESSION", session_name);
14 session_set_env (session, "GDMSESSION", session_name);
15+ desktop_name = session_config_get_desktop_name (session_config);
16+ if (desktop_name)
17+ session_set_env (session, "XDG_CURRENT_DESKTOP", desktop_name);
18 if (language && language[0] != '\0')
19 {
20 session_set_env (session, "LANG", language);
21
22=== modified file 'src/session-config.c'
23--- src/session-config.c 2013-07-24 05:58:34 +0000
24+++ src/session-config.c 2013-08-19 00:27:13 +0000
25@@ -16,6 +16,9 @@
26 /* Session type */
27 gchar *session_type;
28
29+ /* Desktop name */
30+ gchar *desktop_name;
31+
32 /* Command to run */
33 gchar *command;
34 };
35@@ -47,6 +50,7 @@
36 config->priv->session_type = g_key_file_get_string (desktop_file, G_KEY_FILE_DESKTOP_GROUP, "X-LightDM-Session-Type", NULL);
37 if (!config->priv->session_type)
38 config->priv->session_type = g_strdup ("x");
39+ config->priv->desktop_name = g_key_file_get_string (desktop_file, G_KEY_FILE_DESKTOP_GROUP, "X-LightDM-DesktopName", NULL);
40
41 g_key_file_free (desktop_file);
42
43@@ -67,6 +71,13 @@
44 return config->priv->session_type;
45 }
46
47+const gchar *
48+session_config_get_desktop_name (SessionConfig *config)
49+{
50+ g_return_val_if_fail (config != NULL, NULL);
51+ return config->priv->desktop_name;
52+}
53+
54 static void
55 session_config_init (SessionConfig *config)
56 {
57@@ -79,6 +90,7 @@
58 SessionConfig *self = SESSION_CONFIG (object);
59
60 g_free (self->priv->session_type);
61+ g_free (self->priv->desktop_name);
62 g_free (self->priv->command);
63
64 G_OBJECT_CLASS (session_config_parent_class)->finalize (object);
65
66=== modified file 'src/session-config.h'
67--- src/session-config.h 2013-07-24 05:58:34 +0000
68+++ src/session-config.h 2013-08-19 00:27:13 +0000
69@@ -42,6 +42,8 @@
70
71 const gchar *session_config_get_session_type (SessionConfig *config);
72
73+const gchar *session_config_get_desktop_name (SessionConfig *config);
74+
75 G_END_DECLS
76
77 #endif /* SESSION_CONFIG_H_ */
78
79=== modified file 'tests/Makefile.am'
80--- tests/Makefile.am 2013-08-08 10:10:19 +0000
81+++ tests/Makefile.am 2013-08-19 00:27:13 +0000
82@@ -45,6 +45,7 @@
83 test-autologin-guest-logout \
84 test-group-membership \
85 test-session-env \
86+ test-xdg-current-desktop \
87 test-language-env \
88 test-util-path \
89 test-session-stdout \
90@@ -421,6 +422,7 @@
91 scripts/vnc-login.conf \
92 scripts/vnc-open-file-descriptors.conf \
93 scripts/xauthority.conf \
94+ scripts/xdg-current-desktop.conf \
95 scripts/xdmcp-client.conf \
96 scripts/xdmcp-server-login.conf \
97 scripts/xdmcp-server-open-file-descriptors.conf \
98
99=== added file 'tests/data/sessions/named.desktop'
100--- tests/data/sessions/named.desktop 1970-01-01 00:00:00 +0000
101+++ tests/data/sessions/named.desktop 2013-08-19 00:27:13 +0000
102@@ -0,0 +1,5 @@
103+[Desktop Entry]
104+Name=Test Session
105+Comment=LightDM test session
106+Exec=test-session
107+X-LightDM-DesktopName=TestDesktop
108
109=== added file 'tests/scripts/xdg-current-desktop.conf'
110--- tests/scripts/xdg-current-desktop.conf 1970-01-01 00:00:00 +0000
111+++ tests/scripts/xdg-current-desktop.conf 2013-08-19 00:27:13 +0000
112@@ -0,0 +1,28 @@
113+#
114+# Check XDG_CURRENT_DESKTOP is set for sessions that support it
115+#
116+
117+[SeatDefaults]
118+autologin-user=have-password1
119+user-session=named
120+
121+#?RUNNER DAEMON-START
122+
123+# X server starts
124+#?XSERVER-0 START VT=7
125+
126+# Daemon connects when X server is ready
127+#?*XSERVER-0 INDICATE-READY
128+#?XSERVER-0 INDICATE-READY
129+#?XSERVER-0 ACCEPT-CONNECT
130+
131+# Session starts
132+#?SESSION-X-0 START XDG_SEAT=seat0 XDG_VTNR=7 XDG_CURRENT_DESKTOP=TestDesktop USER=have-password1
133+#?XSERVER-0 ACCEPT-CONNECT
134+#?SESSION-X-0 CONNECT-XSERVER
135+
136+# Cleanup
137+#?*STOP-DAEMON
138+#?SESSION-X-0 TERMINATE SIGNAL=15
139+#?XSERVER-0 TERMINATE SIGNAL=15
140+#?RUNNER DAEMON-EXIT STATUS=0
141
142=== modified file 'tests/src/test-session.c'
143--- tests/src/test-session.c 2013-07-30 15:56:44 +0000
144+++ tests/src/test-session.c 2013-08-19 00:27:13 +0000
145@@ -167,13 +167,14 @@
146 int
147 main (int argc, char **argv)
148 {
149- gchar *display, *xdg_seat, *xdg_vtnr, *xdg_session_cookie, *mir_socket, *mir_vt, *mir_id;
150+ gchar *display, *xdg_seat, *xdg_vtnr, *xdg_current_desktop, *xdg_session_cookie, *mir_socket, *mir_vt, *mir_id;
151 GString *status_text;
152 int fd, open_max;
153
154 display = getenv ("DISPLAY");
155 xdg_seat = getenv ("XDG_SEAT");
156 xdg_vtnr = getenv ("XDG_VTNR");
157+ xdg_current_desktop = getenv ("XDG_CURRENT_DESKTOP");
158 xdg_session_cookie = getenv ("XDG_SESSION_COOKIE");
159 mir_socket = getenv ("MIR_SERVER_FILE");
160 mir_vt = getenv ("MIR_SERVER_VT");
161@@ -219,6 +220,8 @@
162 g_string_append_printf (status_text, " XDG_SEAT=%s", xdg_seat);
163 if (xdg_vtnr)
164 g_string_append_printf (status_text, " XDG_VTNR=%s", xdg_vtnr);
165+ if (xdg_current_desktop)
166+ g_string_append_printf (status_text, " XDG_CURRENT_DESKTOP=%s", xdg_current_desktop);
167 if (xdg_session_cookie)
168 g_string_append_printf (status_text, " XDG_SESSION_COOKIE=%s", xdg_session_cookie);
169 if (mir_vt > 0)
170
171=== added file 'tests/test-xdg-current-desktop'
172--- tests/test-xdg-current-desktop 1970-01-01 00:00:00 +0000
173+++ tests/test-xdg-current-desktop 2013-08-19 00:27:13 +0000
174@@ -0,0 +1,2 @@
175+#!/bin/sh
176+./src/dbus-env ./src/test-runner xdg-current-desktop test-gobject-greeter

Subscribers

People subscribed via source and target branches