Merge lp:~donadigo/pantheon-greeter/switch-to-user into lp:~elementary-pantheon/pantheon-greeter/trunk

Proposed by Adam Bieńkowski
Status: Merged
Approved by: Felipe Escoto
Approved revision: 404
Merged at revision: 402
Proposed branch: lp:~donadigo/pantheon-greeter/switch-to-user
Merge into: lp:~elementary-pantheon/pantheon-greeter/trunk
Diff against target: 61 lines (+13/-9)
2 files modified
src/Authenticator.vala (+7/-0)
src/PantheonGreeter.vala (+6/-9)
To merge this branch: bzr merge lp:~donadigo/pantheon-greeter/switch-to-user
Reviewer Review Type Date Requested Status
Felipe Escoto (community) Approve
Review via email: mp+275628@code.launchpad.net

Commit message

* Handle SwitchToUser calls.

Description of the change

The branch fixes current problem with org.freedesktop.DisplayManager.Seat.SwitchToUser calls which are currently not handled at all. It is needed to e.g implement switching users from session indicator (https://bugs.launchpad.net/wingpanel-indicator-session/+bug/1508584).

To post a comment you must log in.
403. By Adam Bieńkowski

Array optimization

404. By Adam Bieńkowski

Removed unneded last_user variable

Revision history for this message
Felipe Escoto (philip.scott) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Authenticator.vala'
2--- src/Authenticator.vala 2015-04-22 21:10:35 +0000
3+++ src/Authenticator.vala 2015-10-24 14:26:12 +0000
4@@ -81,6 +81,7 @@
5 public abstract bool show_manual_login { get; }
6 public abstract bool lock { get; }
7 public abstract string default_session { get; }
8+ public abstract string? select_user { get; }
9
10 /**
11 * Starts the login-procedure for the passed
12@@ -161,6 +162,11 @@
13 return lightdm.default_session_hint;
14 }
15 }
16+ public string? select_user {
17+ get {
18+ return lightdm.select_user_hint;
19+ }
20+ }
21
22 public LightDMGateway () {
23 message ("Connecting to LightDM...");
24@@ -285,6 +291,7 @@
25 public bool show_manual_login { get { return true; } }
26 public bool lock { get {return false; } }
27 public string default_session { get { return ""; } }
28+ public string? select_user { get { return null; } }
29
30 LoginMask last_login_mask;
31
32
33=== modified file 'src/PantheonGreeter.vala'
34--- src/PantheonGreeter.vala 2015-10-22 15:31:03 +0000
35+++ src/PantheonGreeter.vala 2015-10-24 14:26:12 +0000
36@@ -219,19 +219,16 @@
37 greeterbox.set_opacity (255);
38 greeterbox.restore_easing_state ();
39
40- message ("Selecting last used user...");
41-
42- var last_user = get_greeter_state ("last-user");
43-
44- if (last_user == null) {
45- warning ("last user not set");
46- } else {
47+ var select_user = login_gateway.select_user;
48+ var switch_to_user = (select_user != null) ? select_user : get_greeter_state ("last-user");
49+
50+ if (switch_to_user != null) {
51 for (var i = 0; i < userlist.size; i++) {
52- if (userlist.get_user (i).name == last_user) {
53+ if (userlist.get_user (i).name == switch_to_user) {
54 userlist.current_user = userlist.get_user (i);
55 break;
56 }
57- }
58+ }
59 }
60
61 if (userlist.current_user == null)

Subscribers

People subscribed via source and target branches