Merge lp:~robert-ancell/unity-greeter/handle-failed-session-start into lp:unity-greeter

Proposed by Robert Ancell
Status: Merged
Merged at revision: 1200
Proposed branch: lp:~robert-ancell/unity-greeter/handle-failed-session-start
Merge into: lp:unity-greeter
Diff against target: 105 lines (+34/-18)
4 files modified
src/fixes.vapi (+6/-0)
src/greeter-list.vala (+7/-2)
src/unity-greeter.vala (+19/-15)
tests/unity-greeter.vala (+2/-1)
To merge this branch: bzr merge lp:~robert-ancell/unity-greeter/handle-failed-session-start
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Robert Ancell Approve
Review via email: mp+214642@code.launchpad.net

Commit message

Correctly handle session not starting

To post a comment you must log in.
Revision history for this message
Robert Ancell (robert-ancell) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/fixes.vapi'
2--- src/fixes.vapi 2014-04-04 03:58:04 +0000
3+++ src/fixes.vapi 2014-04-08 01:29:50 +0000
4@@ -49,3 +49,9 @@
5
6 public delegate void IdleMonitorWatchFunc (IdleMonitor monitor, uint id);
7 }
8+
9+// Note, fixed in 1.10.0
10+namespace LightDM
11+{
12+ bool greeter_start_session_sync (LightDM.Greeter greeter, string session) throws GLib.Error;
13+}
14
15=== modified file 'src/greeter-list.vala'
16--- src/greeter-list.vala 2014-03-26 04:41:10 +0000
17+++ src/greeter-list.vala 2014-04-08 01:29:50 +0000
18@@ -908,11 +908,16 @@
19
20 private void start_session ()
21 {
22+ if (!UnityGreeter.singleton.start_session (get_lightdm_session (), background))
23+ {
24+ show_message (_("Failed to start session"), true);
25+ start_authentication ();
26+ return;
27+ }
28+
29 /* Set the background */
30 background.draw_grid = false;
31 background.queue_draw ();
32-
33- UnityGreeter.singleton.start_session (get_lightdm_session (), background);
34 }
35
36 public void login_complete ()
37
38=== modified file 'src/unity-greeter.vala'
39--- src/unity-greeter.vala 2014-04-04 03:58:04 +0000
40+++ src/unity-greeter.vala 2014-04-08 01:29:50 +0000
41@@ -181,7 +181,7 @@
42 ctx.add_class ("lightdm");
43 }
44
45- public void start_session (string? session, Background bg)
46+ public bool start_session (string? session, Background bg)
47 {
48 /* Paint our background onto the root window before we close our own window */
49 var c = new Cairo.Context (background_surface);
50@@ -191,21 +191,25 @@
51
52 if (test_mode)
53 {
54- debug ("Successfully logged in! Quitting...");
55- Gtk.main_quit ();
56- }
57- else
58- {
59+ debug ("Successfully logged in! Quitting...");
60+ Gtk.main_quit ();
61+ return true;
62+ }
63+
64+ var result = false;
65+ try
66+ {
67+ result = LightDM.greeter_start_session_sync (greeter, session);
68+ }
69+ catch (Error e)
70+ {
71+ warning ("Failed to start session: %s", e.message);
72+ }
73+
74+ if (result)
75 starting_session ();
76- try
77- {
78- greeter.start_session_sync (session);
79- }
80- catch (Error e)
81- {
82- warning ("Failed to start session: %s", e.message);
83- }
84- }
85+
86+ return result;
87 }
88
89 private bool ready_cb ()
90
91=== modified file 'tests/unity-greeter.vala'
92--- tests/unity-greeter.vala 2013-10-02 17:46:49 +0000
93+++ tests/unity-greeter.vala 2014-04-08 01:29:50 +0000
94@@ -97,9 +97,10 @@
95 return _has_guest_account_hint;
96 }
97
98- public void start_session (string? session, Background bg)
99+ public bool start_session (string? session, Background bg)
100 {
101 session_started = true;
102+ return true;
103 }
104
105 public void push_list (GreeterList widget)

Subscribers

People subscribed via source and target branches