Merge lp:~robert-ancell/lightdm/unity-compositor-command into lp:~mir-team/lightdm/unity

Proposed by Robert Ancell
Status: Merged
Approved by: Chris Halse Rogers
Approved revision: 1626
Merged at revision: 1626
Proposed branch: lp:~robert-ancell/lightdm/unity-compositor-command
Merge into: lp:~mir-team/lightdm/unity
Diff against target: 159 lines (+59/-2)
7 files modified
data/lightdm.conf (+4/-0)
src/lightdm.c (+2/-0)
src/seat-unity.c (+4/-1)
tests/Makefile.am (+2/-0)
tests/scripts/unity-compositor-command.conf (+38/-0)
tests/src/unity-system-compositor.c (+7/-1)
tests/test-unity-compositor-command (+2/-0)
To merge this branch: bzr merge lp:~robert-ancell/lightdm/unity-compositor-command
Reviewer Review Type Date Requested Status
Chris Halse Rogers Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+170734@code.launchpad.net

Commit message

Add option to set compositor command

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Chris Halse Rogers (raof) wrote :

Looks good to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/lightdm.conf'
2--- data/lightdm.conf 2013-06-06 05:02:48 +0000
3+++ data/lightdm.conf 2013-06-21 03:44:24 +0000
4@@ -43,6 +43,8 @@
5 # xdmcp-manager = XDMCP manager to connect to (implies xserver-allow-tcp=true)
6 # xdmcp-port = XDMCP UDP/IP port to communicate on
7 # xdmcp-key = Authentication key to use for XDM-AUTHENTICATION-1 (stored in keys.conf)
8+# unity-compositor-command = Unity compositor command to run (can also contain arguments e.g. unity-system-compositor -special-option)
9+# unity-compositor-timeout = Number of seconds to wait for compositor to start
10 # greeter-session = Session to load for greeter
11 # greeter-hide-users = True to hide the user list
12 # greeter-allow-guest = True if the greeter should show a guest login option
13@@ -72,6 +74,8 @@
14 #xdmcp-manager=
15 #xdmcp-port=177
16 #xdmcp-key=
17+#unity-compositor-command=unity-system-compositor
18+#unity-compositor-timeout=60
19 #greeter-session=example-gtk-gnome
20 #greeter-hide-users=false
21 #greeter-allow-guest=true
22
23=== modified file 'src/lightdm.c'
24--- src/lightdm.c 2013-06-18 02:10:44 +0000
25+++ src/lightdm.c 2013-06-21 03:44:24 +0000
26@@ -1040,6 +1040,8 @@
27 config_set_string (config_get_instance (), "SeatDefaults", "type", "xlocal");
28 if (!config_has_key (config_get_instance (), "SeatDefaults", "xserver-command"))
29 config_set_string (config_get_instance (), "SeatDefaults", "xserver-command", "X");
30+ if (!config_has_key (config_get_instance (), "SeatDefaults", "unity-compositor-command"))
31+ config_set_string (config_get_instance (), "SeatDefaults", "unity-compositor-command", "unity-system-compositor");
32 if (!config_has_key (config_get_instance (), "SeatDefaults", "start-session"))
33 config_set_boolean (config_get_instance (), "SeatDefaults", "start-session", TRUE);
34 if (!config_has_key (config_get_instance (), "SeatDefaults", "allow-guest"))
35
36=== modified file 'src/seat-unity.c'
37--- src/seat-unity.c 2013-06-20 08:50:35 +0000
38+++ src/seat-unity.c 2013-06-21 03:44:24 +0000
39@@ -293,6 +293,7 @@
40 static gboolean
41 seat_unity_start (Seat *seat)
42 {
43+ const gchar *compositor_command;
44 gchar *command, *absolute_command, *dir;
45 gboolean result;
46 int timeout;
47@@ -341,7 +342,9 @@
48 g_free (dir);
49
50 SEAT_UNITY (seat)->priv->mir_socket_filename = g_strdup ("/tmp/mir_socket"); // FIXME: Use this socket by default as XMir is hardcoded to this
51- command = g_strdup_printf ("unity-system-compositor --from-dm-fd %d --to-dm-fd %d", SEAT_UNITY (seat)->priv->to_compositor_pipe[0], SEAT_UNITY (seat)->priv->from_compositor_pipe[1]);
52+ timeout = seat_get_integer_property (seat, "unity-compositor-timeout");
53+ compositor_command = seat_get_string_property (seat, "unity-compositor-command");
54+ command = g_strdup_printf ("%s --from-dm-fd %d --to-dm-fd %d", compositor_command, SEAT_UNITY (seat)->priv->to_compositor_pipe[0], SEAT_UNITY (seat)->priv->from_compositor_pipe[1]);
55
56 absolute_command = get_absolute_command (command);
57 g_free (command);
58
59=== modified file 'tests/Makefile.am'
60--- tests/Makefile.am 2013-06-21 02:23:32 +0000
61+++ tests/Makefile.am 2013-06-21 03:44:24 +0000
62@@ -151,6 +151,7 @@
63 test-python-power-no-services \
64 test-open-file-descriptors \
65 test-xdmcp-open-file-descriptors \
66+ test-unity-compositor-command \
67 test-unity-compositor-fail-start \
68 test-unity-compositor-fail-ready \
69 test-unity-autologin \
70@@ -353,6 +354,7 @@
71 scripts/switch-to-user-no-password.conf \
72 scripts/system-xauthority.conf \
73 scripts/unity-autologin.conf \
74+ scripts/unity-compositor-command.conf \
75 scripts/unity-compositor-fail-ready.conf \
76 scripts/unity-compositor-fail-start.conf \
77 scripts/unity-login.conf \
78
79=== added file 'tests/scripts/unity-compositor-command.conf'
80--- tests/scripts/unity-compositor-command.conf 1970-01-01 00:00:00 +0000
81+++ tests/scripts/unity-compositor-command.conf 2013-06-21 03:44:24 +0000
82@@ -0,0 +1,38 @@
83+#
84+# Check can set the unity compositor command
85+#
86+
87+[SeatDefaults]
88+type=unity
89+user-session=default
90+unity-compositor-command=unity-system-compositor --test
91+
92+#?RUNNER DAEMON-START
93+
94+# System compositor starts
95+#?UNITY-SYSTEM-COMPOSITOR START TEST
96+#?*UNITY-SYSTEM-COMPOSITOR READY
97+
98+# X server starts
99+#?XSERVER-0 START MIR-ID=0
100+#?XSERVER-0 INDICATE-READY
101+
102+# LightDM connects to X server
103+#?XSERVER-0 ACCEPT-CONNECT
104+
105+# Greeter starts
106+#?GREETER-X-0 START
107+#?XSERVER-0 ACCEPT-CONNECT
108+#?GREETER-X-0 CONNECT-XSERVER
109+#?GREETER-X-0 CONNECT-TO-DAEMON
110+#?GREETER-X-0 CONNECTED-TO-DAEMON
111+
112+# System compositor switches to greeter
113+#?UNITY-SYSTEM-COMPOSITOR SET-ACTIVE-SESSION ID=0
114+
115+# Cleanup
116+#?*STOP-DAEMON
117+#?GREETER-X-0 TERMINATE SIGNAL=15
118+#?XSERVER-0 TERMINATE SIGNAL=15
119+#?UNITY-SYSTEM-COMPOSITOR TERMINATE SIGNAL=15
120+#?RUNNER DAEMON-EXIT STATUS=0
121
122=== modified file 'tests/src/unity-system-compositor.c'
123--- tests/src/unity-system-compositor.c 2013-06-21 02:23:32 +0000
124+++ tests/src/unity-system-compositor.c 2013-06-21 03:44:24 +0000
125@@ -123,6 +123,7 @@
126 main (int argc, char **argv)
127 {
128 int i;
129+ gboolean test = FALSE;
130
131 signal (SIGINT, signal_cb);
132 signal (SIGTERM, signal_cb);
133@@ -150,13 +151,18 @@
134 to_dm_fd = atoi (argv[i+1]);
135 i++;
136 }
137+ else if (strcmp (arg, "--test") == 0)
138+ test = TRUE;
139 else
140 return EXIT_FAILURE;
141 }
142
143 g_io_add_watch (g_io_channel_unix_new (from_dm_fd), G_IO_IN, read_message_cb, NULL);
144
145- status_notify ("UNITY-SYSTEM-COMPOSITOR START");
146+ if (test)
147+ status_notify ("UNITY-SYSTEM-COMPOSITOR START TEST");
148+ else
149+ status_notify ("UNITY-SYSTEM-COMPOSITOR START");
150
151 config = g_key_file_new ();
152 g_key_file_load_from_file (config, g_build_filename (g_getenv ("LIGHTDM_TEST_ROOT"), "script", NULL), G_KEY_FILE_NONE, NULL);
153
154=== added file 'tests/test-unity-compositor-command'
155--- tests/test-unity-compositor-command 1970-01-01 00:00:00 +0000
156+++ tests/test-unity-compositor-command 2013-06-21 03:44:24 +0000
157@@ -0,0 +1,2 @@
158+#!/bin/sh
159+./src/dbus-env ./src/test-runner unity-compositor-command test-gobject-greeter

Subscribers

People subscribed via source and target branches