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
=== modified file 'data/lightdm.conf'
--- data/lightdm.conf 2013-06-06 05:02:48 +0000
+++ data/lightdm.conf 2013-06-21 03:44:24 +0000
@@ -43,6 +43,8 @@
43# xdmcp-manager = XDMCP manager to connect to (implies xserver-allow-tcp=true)43# xdmcp-manager = XDMCP manager to connect to (implies xserver-allow-tcp=true)
44# xdmcp-port = XDMCP UDP/IP port to communicate on44# xdmcp-port = XDMCP UDP/IP port to communicate on
45# xdmcp-key = Authentication key to use for XDM-AUTHENTICATION-1 (stored in keys.conf)45# xdmcp-key = Authentication key to use for XDM-AUTHENTICATION-1 (stored in keys.conf)
46# unity-compositor-command = Unity compositor command to run (can also contain arguments e.g. unity-system-compositor -special-option)
47# unity-compositor-timeout = Number of seconds to wait for compositor to start
46# greeter-session = Session to load for greeter48# greeter-session = Session to load for greeter
47# greeter-hide-users = True to hide the user list49# greeter-hide-users = True to hide the user list
48# greeter-allow-guest = True if the greeter should show a guest login option50# greeter-allow-guest = True if the greeter should show a guest login option
@@ -72,6 +74,8 @@
72#xdmcp-manager=74#xdmcp-manager=
73#xdmcp-port=17775#xdmcp-port=177
74#xdmcp-key=76#xdmcp-key=
77#unity-compositor-command=unity-system-compositor
78#unity-compositor-timeout=60
75#greeter-session=example-gtk-gnome79#greeter-session=example-gtk-gnome
76#greeter-hide-users=false80#greeter-hide-users=false
77#greeter-allow-guest=true81#greeter-allow-guest=true
7882
=== modified file 'src/lightdm.c'
--- src/lightdm.c 2013-06-18 02:10:44 +0000
+++ src/lightdm.c 2013-06-21 03:44:24 +0000
@@ -1040,6 +1040,8 @@
1040 config_set_string (config_get_instance (), "SeatDefaults", "type", "xlocal");1040 config_set_string (config_get_instance (), "SeatDefaults", "type", "xlocal");
1041 if (!config_has_key (config_get_instance (), "SeatDefaults", "xserver-command"))1041 if (!config_has_key (config_get_instance (), "SeatDefaults", "xserver-command"))
1042 config_set_string (config_get_instance (), "SeatDefaults", "xserver-command", "X");1042 config_set_string (config_get_instance (), "SeatDefaults", "xserver-command", "X");
1043 if (!config_has_key (config_get_instance (), "SeatDefaults", "unity-compositor-command"))
1044 config_set_string (config_get_instance (), "SeatDefaults", "unity-compositor-command", "unity-system-compositor");
1043 if (!config_has_key (config_get_instance (), "SeatDefaults", "start-session"))1045 if (!config_has_key (config_get_instance (), "SeatDefaults", "start-session"))
1044 config_set_boolean (config_get_instance (), "SeatDefaults", "start-session", TRUE);1046 config_set_boolean (config_get_instance (), "SeatDefaults", "start-session", TRUE);
1045 if (!config_has_key (config_get_instance (), "SeatDefaults", "allow-guest"))1047 if (!config_has_key (config_get_instance (), "SeatDefaults", "allow-guest"))
10461048
=== modified file 'src/seat-unity.c'
--- src/seat-unity.c 2013-06-20 08:50:35 +0000
+++ src/seat-unity.c 2013-06-21 03:44:24 +0000
@@ -293,6 +293,7 @@
293static gboolean293static gboolean
294seat_unity_start (Seat *seat)294seat_unity_start (Seat *seat)
295{295{
296 const gchar *compositor_command;
296 gchar *command, *absolute_command, *dir;297 gchar *command, *absolute_command, *dir;
297 gboolean result;298 gboolean result;
298 int timeout;299 int timeout;
@@ -341,7 +342,9 @@
341 g_free (dir);342 g_free (dir);
342343
343 SEAT_UNITY (seat)->priv->mir_socket_filename = g_strdup ("/tmp/mir_socket"); // FIXME: Use this socket by default as XMir is hardcoded to this344 SEAT_UNITY (seat)->priv->mir_socket_filename = g_strdup ("/tmp/mir_socket"); // FIXME: Use this socket by default as XMir is hardcoded to this
344 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]);345 timeout = seat_get_integer_property (seat, "unity-compositor-timeout");
346 compositor_command = seat_get_string_property (seat, "unity-compositor-command");
347 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]);
345348
346 absolute_command = get_absolute_command (command);349 absolute_command = get_absolute_command (command);
347 g_free (command);350 g_free (command);
348351
=== modified file 'tests/Makefile.am'
--- tests/Makefile.am 2013-06-21 02:23:32 +0000
+++ tests/Makefile.am 2013-06-21 03:44:24 +0000
@@ -151,6 +151,7 @@
151 test-python-power-no-services \151 test-python-power-no-services \
152 test-open-file-descriptors \152 test-open-file-descriptors \
153 test-xdmcp-open-file-descriptors \153 test-xdmcp-open-file-descriptors \
154 test-unity-compositor-command \
154 test-unity-compositor-fail-start \155 test-unity-compositor-fail-start \
155 test-unity-compositor-fail-ready \156 test-unity-compositor-fail-ready \
156 test-unity-autologin \157 test-unity-autologin \
@@ -353,6 +354,7 @@
353 scripts/switch-to-user-no-password.conf \354 scripts/switch-to-user-no-password.conf \
354 scripts/system-xauthority.conf \355 scripts/system-xauthority.conf \
355 scripts/unity-autologin.conf \356 scripts/unity-autologin.conf \
357 scripts/unity-compositor-command.conf \
356 scripts/unity-compositor-fail-ready.conf \358 scripts/unity-compositor-fail-ready.conf \
357 scripts/unity-compositor-fail-start.conf \359 scripts/unity-compositor-fail-start.conf \
358 scripts/unity-login.conf \360 scripts/unity-login.conf \
359361
=== added file 'tests/scripts/unity-compositor-command.conf'
--- tests/scripts/unity-compositor-command.conf 1970-01-01 00:00:00 +0000
+++ tests/scripts/unity-compositor-command.conf 2013-06-21 03:44:24 +0000
@@ -0,0 +1,38 @@
1#
2# Check can set the unity compositor command
3#
4
5[SeatDefaults]
6type=unity
7user-session=default
8unity-compositor-command=unity-system-compositor --test
9
10#?RUNNER DAEMON-START
11
12# System compositor starts
13#?UNITY-SYSTEM-COMPOSITOR START TEST
14#?*UNITY-SYSTEM-COMPOSITOR READY
15
16# X server starts
17#?XSERVER-0 START MIR-ID=0
18#?XSERVER-0 INDICATE-READY
19
20# LightDM connects to X server
21#?XSERVER-0 ACCEPT-CONNECT
22
23# Greeter starts
24#?GREETER-X-0 START
25#?XSERVER-0 ACCEPT-CONNECT
26#?GREETER-X-0 CONNECT-XSERVER
27#?GREETER-X-0 CONNECT-TO-DAEMON
28#?GREETER-X-0 CONNECTED-TO-DAEMON
29
30# System compositor switches to greeter
31#?UNITY-SYSTEM-COMPOSITOR SET-ACTIVE-SESSION ID=0
32
33# Cleanup
34#?*STOP-DAEMON
35#?GREETER-X-0 TERMINATE SIGNAL=15
36#?XSERVER-0 TERMINATE SIGNAL=15
37#?UNITY-SYSTEM-COMPOSITOR TERMINATE SIGNAL=15
38#?RUNNER DAEMON-EXIT STATUS=0
039
=== modified file 'tests/src/unity-system-compositor.c'
--- tests/src/unity-system-compositor.c 2013-06-21 02:23:32 +0000
+++ tests/src/unity-system-compositor.c 2013-06-21 03:44:24 +0000
@@ -123,6 +123,7 @@
123main (int argc, char **argv)123main (int argc, char **argv)
124{124{
125 int i;125 int i;
126 gboolean test = FALSE;
126127
127 signal (SIGINT, signal_cb);128 signal (SIGINT, signal_cb);
128 signal (SIGTERM, signal_cb);129 signal (SIGTERM, signal_cb);
@@ -150,13 +151,18 @@
150 to_dm_fd = atoi (argv[i+1]);151 to_dm_fd = atoi (argv[i+1]);
151 i++;152 i++;
152 }153 }
154 else if (strcmp (arg, "--test") == 0)
155 test = TRUE;
153 else156 else
154 return EXIT_FAILURE;157 return EXIT_FAILURE;
155 }158 }
156159
157 g_io_add_watch (g_io_channel_unix_new (from_dm_fd), G_IO_IN, read_message_cb, NULL);160 g_io_add_watch (g_io_channel_unix_new (from_dm_fd), G_IO_IN, read_message_cb, NULL);
158161
159 status_notify ("UNITY-SYSTEM-COMPOSITOR START");162 if (test)
163 status_notify ("UNITY-SYSTEM-COMPOSITOR START TEST");
164 else
165 status_notify ("UNITY-SYSTEM-COMPOSITOR START");
160166
161 config = g_key_file_new ();167 config = g_key_file_new ();
162 g_key_file_load_from_file (config, g_build_filename (g_getenv ("LIGHTDM_TEST_ROOT"), "script", NULL), G_KEY_FILE_NONE, NULL);168 g_key_file_load_from_file (config, g_build_filename (g_getenv ("LIGHTDM_TEST_ROOT"), "script", NULL), G_KEY_FILE_NONE, NULL);
163169
=== added file 'tests/test-unity-compositor-command'
--- tests/test-unity-compositor-command 1970-01-01 00:00:00 +0000
+++ tests/test-unity-compositor-command 2013-06-21 03:44:24 +0000
@@ -0,0 +1,2 @@
1#!/bin/sh
2./src/dbus-env ./src/test-runner unity-compositor-command test-gobject-greeter

Subscribers

People subscribed via source and target branches