Merge lp:~mterry/lightdm/upstart into lp:lightdm

Proposed by Michael Terry
Status: Merged
Merged at revision: 1084
Proposed branch: lp:~mterry/lightdm/upstart
Merge into: lp:lightdm
Diff against target: 63 lines (+23/-0)
2 files modified
data/init/lightdm.conf (+3/-0)
src/seat.c (+20/-0)
To merge this branch: bzr merge lp:~mterry/lightdm/upstart
Reviewer Review Type Date Requested Status
Robert Ancell Approve
Review via email: mp+73082@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Robert Ancell (robert-ancell) wrote :

Feedback:
- It emits 'user-session-start' instead of 'desktop-session-start' as listed in lightdm.conf and the .pdf.
- It's probably easier to do this in seat.c and do this in the ready and session-started signal handlers.

I'm not sure what the exact point of the events are (will ask more in the bug).

review: Needs Fixing
lp:~mterry/lightdm/upstart updated
1070. By Michael Terry

move upstart signal emission to seat.c

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

Good catch on user-session-start.

I've updated this branch to fix that and move the code to seat.c. Please re-review.

lp:~mterry/lightdm/upstart updated
1071. By Michael Terry

merge from trunk

Revision history for this message
Robert Ancell (robert-ancell) wrote :

Not sure if they are in the right place, but I'll apply this for now and we can move them if they're not right.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'data/init/lightdm.conf'
--- data/init/lightdm.conf 2010-08-23 06:23:33 +0000
+++ data/init/lightdm.conf 2011-08-30 13:49:26 +0000
@@ -6,4 +6,7 @@
6description "LightDM Display Manager"6description "LightDM Display Manager"
7author "Robert Ancell <robert.ancell@gmail.com>"7author "Robert Ancell <robert.ancell@gmail.com>"
88
9emits login-session-start
10emits desktop-session-start
11
9exec /usr/bin/lightdm12exec /usr/bin/lightdm
1013
=== modified file 'src/seat.c'
--- src/seat.c 2011-08-29 05:13:48 +0000
+++ src/seat.c 2011-08-30 13:49:26 +0000
@@ -335,6 +335,17 @@
335}335}
336336
337static void337static void
338emit_upstart_signal (const gchar *signal)
339{
340 g_return_if_fail (signal != NULL);
341 g_return_if_fail (signal[0] != 0);
342
343 gchar *cmd = g_strdup_printf ("/sbin/initctl -q emit %s DISPLAY_MANAGER=lightdm", signal);
344 g_spawn_command_line_async (cmd, NULL); /* OK if it fails, probably not installed */
345 g_free (cmd);
346}
347
348static void
338display_ready_cb (Display *display, Seat *seat)349display_ready_cb (Display *display, Seat *seat)
339{350{
340 const gchar *script;351 const gchar *script;
@@ -346,6 +357,8 @@
346357
347 /* Switch to this new display */358 /* Switch to this new display */
348 SEAT_GET_CLASS (seat)->set_active_display (seat, display);359 SEAT_GET_CLASS (seat)->set_active_display (seat, display);
360
361 emit_upstart_signal ("login-session-start");
349}362}
350363
351static void364static void
@@ -362,6 +375,12 @@
362}375}
363376
364static void377static void
378display_session_started_cb (Display *display, Seat *seat)
379{
380 emit_upstart_signal ("desktop-session-start");
381}
382
383static void
365display_session_stopped_cb (Display *display, Seat *seat)384display_session_stopped_cb (Display *display, Seat *seat)
366{385{
367 Session *session;386 Session *session;
@@ -456,6 +475,7 @@
456 g_signal_connect (new_display, "get-guest-username", G_CALLBACK (display_get_guest_username_cb), seat);475 g_signal_connect (new_display, "get-guest-username", G_CALLBACK (display_get_guest_username_cb), seat);
457 g_signal_connect (new_display, "ready", G_CALLBACK (display_ready_cb), seat);476 g_signal_connect (new_display, "ready", G_CALLBACK (display_ready_cb), seat);
458 g_signal_connect (new_display, "session-created", G_CALLBACK (display_session_created_cb), seat);477 g_signal_connect (new_display, "session-created", G_CALLBACK (display_session_created_cb), seat);
478 g_signal_connect (new_display, "session-started", G_CALLBACK (display_session_started_cb), seat);
459 g_signal_connect (new_display, "session-stopped", G_CALLBACK (display_session_stopped_cb), seat);479 g_signal_connect (new_display, "session-stopped", G_CALLBACK (display_session_stopped_cb), seat);
460 g_signal_connect (new_display, "stopped", G_CALLBACK (display_stopped_cb), seat);480 g_signal_connect (new_display, "stopped", G_CALLBACK (display_stopped_cb), seat);
461 display_set_greeter_session (new_display, seat_get_string_property (seat, "greeter-session"));481 display_set_greeter_session (new_display, seat_get_string_property (seat, "greeter-session"));

Subscribers

People subscribed via source and target branches