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

Proposed by Robert Ancell on 2013-08-19
Status: Merged
Approved by: Michael Terry on 2013-08-19
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 on 2013-08-19
Michael Terry 2013-08-19 Approve on 2013-08-19
LightDM Development Team 2013-08-19 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.
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)
Michael Terry (mterry) wrote :

Looks good to me!

review: Approve
Michael Terry (mterry) wrote :

Test seems like a jenkins issue. Will retry.

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/seat.c'
--- src/seat.c 2013-08-08 10:10:19 +0000
+++ src/seat.c 2013-08-19 00:27:13 +0000
@@ -774,12 +774,16 @@
774 g_free (sessions_dir);774 g_free (sessions_dir);
775 if (session_config)775 if (session_config)
776 {776 {
777 const gchar *desktop_name;
777 gchar **argv;778 gchar **argv;
778779
779 session = create_session (seat, TRUE);780 session = create_session (seat, TRUE);
780 session_set_session_type (session, session_config_get_session_type (session_config));781 session_set_session_type (session, session_config_get_session_type (session_config));
781 session_set_env (session, "DESKTOP_SESSION", session_name);782 session_set_env (session, "DESKTOP_SESSION", session_name);
782 session_set_env (session, "GDMSESSION", session_name);783 session_set_env (session, "GDMSESSION", session_name);
784 desktop_name = session_config_get_desktop_name (session_config);
785 if (desktop_name)
786 session_set_env (session, "XDG_CURRENT_DESKTOP", desktop_name);
783 if (language && language[0] != '\0')787 if (language && language[0] != '\0')
784 {788 {
785 session_set_env (session, "LANG", language);789 session_set_env (session, "LANG", language);
786790
=== modified file 'src/session-config.c'
--- src/session-config.c 2013-07-24 05:58:34 +0000
+++ src/session-config.c 2013-08-19 00:27:13 +0000
@@ -16,6 +16,9 @@
16 /* Session type */16 /* Session type */
17 gchar *session_type;17 gchar *session_type;
1818
19 /* Desktop name */
20 gchar *desktop_name;
21
19 /* Command to run */22 /* Command to run */
20 gchar *command;23 gchar *command;
21};24};
@@ -47,6 +50,7 @@
47 config->priv->session_type = g_key_file_get_string (desktop_file, G_KEY_FILE_DESKTOP_GROUP, "X-LightDM-Session-Type", NULL);50 config->priv->session_type = g_key_file_get_string (desktop_file, G_KEY_FILE_DESKTOP_GROUP, "X-LightDM-Session-Type", NULL);
48 if (!config->priv->session_type)51 if (!config->priv->session_type)
49 config->priv->session_type = g_strdup ("x");52 config->priv->session_type = g_strdup ("x");
53 config->priv->desktop_name = g_key_file_get_string (desktop_file, G_KEY_FILE_DESKTOP_GROUP, "X-LightDM-DesktopName", NULL);
5054
51 g_key_file_free (desktop_file);55 g_key_file_free (desktop_file);
5256
@@ -67,6 +71,13 @@
67 return config->priv->session_type;71 return config->priv->session_type;
68}72}
6973
74const gchar *
75session_config_get_desktop_name (SessionConfig *config)
76{
77 g_return_val_if_fail (config != NULL, NULL);
78 return config->priv->desktop_name;
79}
80
70static void81static void
71session_config_init (SessionConfig *config)82session_config_init (SessionConfig *config)
72{83{
@@ -79,6 +90,7 @@
79 SessionConfig *self = SESSION_CONFIG (object);90 SessionConfig *self = SESSION_CONFIG (object);
8091
81 g_free (self->priv->session_type);92 g_free (self->priv->session_type);
93 g_free (self->priv->desktop_name);
82 g_free (self->priv->command);94 g_free (self->priv->command);
8395
84 G_OBJECT_CLASS (session_config_parent_class)->finalize (object);96 G_OBJECT_CLASS (session_config_parent_class)->finalize (object);
8597
=== modified file 'src/session-config.h'
--- src/session-config.h 2013-07-24 05:58:34 +0000
+++ src/session-config.h 2013-08-19 00:27:13 +0000
@@ -42,6 +42,8 @@
4242
43const gchar *session_config_get_session_type (SessionConfig *config);43const gchar *session_config_get_session_type (SessionConfig *config);
4444
45const gchar *session_config_get_desktop_name (SessionConfig *config);
46
45G_END_DECLS47G_END_DECLS
4648
47#endif /* SESSION_CONFIG_H_ */49#endif /* SESSION_CONFIG_H_ */
4850
=== modified file 'tests/Makefile.am'
--- tests/Makefile.am 2013-08-08 10:10:19 +0000
+++ tests/Makefile.am 2013-08-19 00:27:13 +0000
@@ -45,6 +45,7 @@
45 test-autologin-guest-logout \45 test-autologin-guest-logout \
46 test-group-membership \46 test-group-membership \
47 test-session-env \47 test-session-env \
48 test-xdg-current-desktop \
48 test-language-env \49 test-language-env \
49 test-util-path \50 test-util-path \
50 test-session-stdout \51 test-session-stdout \
@@ -421,6 +422,7 @@
421 scripts/vnc-login.conf \422 scripts/vnc-login.conf \
422 scripts/vnc-open-file-descriptors.conf \423 scripts/vnc-open-file-descriptors.conf \
423 scripts/xauthority.conf \424 scripts/xauthority.conf \
425 scripts/xdg-current-desktop.conf \
424 scripts/xdmcp-client.conf \426 scripts/xdmcp-client.conf \
425 scripts/xdmcp-server-login.conf \427 scripts/xdmcp-server-login.conf \
426 scripts/xdmcp-server-open-file-descriptors.conf \428 scripts/xdmcp-server-open-file-descriptors.conf \
427429
=== added file 'tests/data/sessions/named.desktop'
--- tests/data/sessions/named.desktop 1970-01-01 00:00:00 +0000
+++ tests/data/sessions/named.desktop 2013-08-19 00:27:13 +0000
@@ -0,0 +1,5 @@
1[Desktop Entry]
2Name=Test Session
3Comment=LightDM test session
4Exec=test-session
5X-LightDM-DesktopName=TestDesktop
06
=== added file 'tests/scripts/xdg-current-desktop.conf'
--- tests/scripts/xdg-current-desktop.conf 1970-01-01 00:00:00 +0000
+++ tests/scripts/xdg-current-desktop.conf 2013-08-19 00:27:13 +0000
@@ -0,0 +1,28 @@
1#
2# Check XDG_CURRENT_DESKTOP is set for sessions that support it
3#
4
5[SeatDefaults]
6autologin-user=have-password1
7user-session=named
8
9#?RUNNER DAEMON-START
10
11# X server starts
12#?XSERVER-0 START VT=7
13
14# Daemon connects when X server is ready
15#?*XSERVER-0 INDICATE-READY
16#?XSERVER-0 INDICATE-READY
17#?XSERVER-0 ACCEPT-CONNECT
18
19# Session starts
20#?SESSION-X-0 START XDG_SEAT=seat0 XDG_VTNR=7 XDG_CURRENT_DESKTOP=TestDesktop USER=have-password1
21#?XSERVER-0 ACCEPT-CONNECT
22#?SESSION-X-0 CONNECT-XSERVER
23
24# Cleanup
25#?*STOP-DAEMON
26#?SESSION-X-0 TERMINATE SIGNAL=15
27#?XSERVER-0 TERMINATE SIGNAL=15
28#?RUNNER DAEMON-EXIT STATUS=0
029
=== modified file 'tests/src/test-session.c'
--- tests/src/test-session.c 2013-07-30 15:56:44 +0000
+++ tests/src/test-session.c 2013-08-19 00:27:13 +0000
@@ -167,13 +167,14 @@
167int167int
168main (int argc, char **argv)168main (int argc, char **argv)
169{169{
170 gchar *display, *xdg_seat, *xdg_vtnr, *xdg_session_cookie, *mir_socket, *mir_vt, *mir_id;170 gchar *display, *xdg_seat, *xdg_vtnr, *xdg_current_desktop, *xdg_session_cookie, *mir_socket, *mir_vt, *mir_id;
171 GString *status_text;171 GString *status_text;
172 int fd, open_max;172 int fd, open_max;
173173
174 display = getenv ("DISPLAY");174 display = getenv ("DISPLAY");
175 xdg_seat = getenv ("XDG_SEAT");175 xdg_seat = getenv ("XDG_SEAT");
176 xdg_vtnr = getenv ("XDG_VTNR");176 xdg_vtnr = getenv ("XDG_VTNR");
177 xdg_current_desktop = getenv ("XDG_CURRENT_DESKTOP");
177 xdg_session_cookie = getenv ("XDG_SESSION_COOKIE");178 xdg_session_cookie = getenv ("XDG_SESSION_COOKIE");
178 mir_socket = getenv ("MIR_SERVER_FILE");179 mir_socket = getenv ("MIR_SERVER_FILE");
179 mir_vt = getenv ("MIR_SERVER_VT");180 mir_vt = getenv ("MIR_SERVER_VT");
@@ -219,6 +220,8 @@
219 g_string_append_printf (status_text, " XDG_SEAT=%s", xdg_seat);220 g_string_append_printf (status_text, " XDG_SEAT=%s", xdg_seat);
220 if (xdg_vtnr)221 if (xdg_vtnr)
221 g_string_append_printf (status_text, " XDG_VTNR=%s", xdg_vtnr);222 g_string_append_printf (status_text, " XDG_VTNR=%s", xdg_vtnr);
223 if (xdg_current_desktop)
224 g_string_append_printf (status_text, " XDG_CURRENT_DESKTOP=%s", xdg_current_desktop);
222 if (xdg_session_cookie)225 if (xdg_session_cookie)
223 g_string_append_printf (status_text, " XDG_SESSION_COOKIE=%s", xdg_session_cookie);226 g_string_append_printf (status_text, " XDG_SESSION_COOKIE=%s", xdg_session_cookie);
224 if (mir_vt > 0)227 if (mir_vt > 0)
225228
=== added file 'tests/test-xdg-current-desktop'
--- tests/test-xdg-current-desktop 1970-01-01 00:00:00 +0000
+++ tests/test-xdg-current-desktop 2013-08-19 00:27:13 +0000
@@ -0,0 +1,2 @@
1#!/bin/sh
2./src/dbus-env ./src/test-runner xdg-current-desktop test-gobject-greeter

Subscribers

People subscribed via source and target branches