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
1=== modified file 'data/init/lightdm.conf'
2--- data/init/lightdm.conf 2010-08-23 06:23:33 +0000
3+++ data/init/lightdm.conf 2011-08-30 13:49:26 +0000
4@@ -6,4 +6,7 @@
5 description "LightDM Display Manager"
6 author "Robert Ancell <robert.ancell@gmail.com>"
7
8+emits login-session-start
9+emits desktop-session-start
10+
11 exec /usr/bin/lightdm
12
13=== modified file 'src/seat.c'
14--- src/seat.c 2011-08-29 05:13:48 +0000
15+++ src/seat.c 2011-08-30 13:49:26 +0000
16@@ -335,6 +335,17 @@
17 }
18
19 static void
20+emit_upstart_signal (const gchar *signal)
21+{
22+ g_return_if_fail (signal != NULL);
23+ g_return_if_fail (signal[0] != 0);
24+
25+ gchar *cmd = g_strdup_printf ("/sbin/initctl -q emit %s DISPLAY_MANAGER=lightdm", signal);
26+ g_spawn_command_line_async (cmd, NULL); /* OK if it fails, probably not installed */
27+ g_free (cmd);
28+}
29+
30+static void
31 display_ready_cb (Display *display, Seat *seat)
32 {
33 const gchar *script;
34@@ -346,6 +357,8 @@
35
36 /* Switch to this new display */
37 SEAT_GET_CLASS (seat)->set_active_display (seat, display);
38+
39+ emit_upstart_signal ("login-session-start");
40 }
41
42 static void
43@@ -362,6 +375,12 @@
44 }
45
46 static void
47+display_session_started_cb (Display *display, Seat *seat)
48+{
49+ emit_upstart_signal ("desktop-session-start");
50+}
51+
52+static void
53 display_session_stopped_cb (Display *display, Seat *seat)
54 {
55 Session *session;
56@@ -456,6 +475,7 @@
57 g_signal_connect (new_display, "get-guest-username", G_CALLBACK (display_get_guest_username_cb), seat);
58 g_signal_connect (new_display, "ready", G_CALLBACK (display_ready_cb), seat);
59 g_signal_connect (new_display, "session-created", G_CALLBACK (display_session_created_cb), seat);
60+ g_signal_connect (new_display, "session-started", G_CALLBACK (display_session_started_cb), seat);
61 g_signal_connect (new_display, "session-stopped", G_CALLBACK (display_session_stopped_cb), seat);
62 g_signal_connect (new_display, "stopped", G_CALLBACK (display_stopped_cb), seat);
63 display_set_greeter_session (new_display, seat_get_string_property (seat, "greeter-session"));

Subscribers

People subscribed via source and target branches