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
=== modified file 'src/Authenticator.vala'
--- src/Authenticator.vala 2015-04-22 21:10:35 +0000
+++ src/Authenticator.vala 2015-10-24 14:26:12 +0000
@@ -81,6 +81,7 @@
81 public abstract bool show_manual_login { get; }81 public abstract bool show_manual_login { get; }
82 public abstract bool lock { get; }82 public abstract bool lock { get; }
83 public abstract string default_session { get; }83 public abstract string default_session { get; }
84 public abstract string? select_user { get; }
8485
85 /**86 /**
86 * Starts the login-procedure for the passed87 * Starts the login-procedure for the passed
@@ -161,6 +162,11 @@
161 return lightdm.default_session_hint;162 return lightdm.default_session_hint;
162 }163 }
163 }164 }
165 public string? select_user {
166 get {
167 return lightdm.select_user_hint;
168 }
169 }
164170
165 public LightDMGateway () {171 public LightDMGateway () {
166 message ("Connecting to LightDM...");172 message ("Connecting to LightDM...");
@@ -285,6 +291,7 @@
285 public bool show_manual_login { get { return true; } }291 public bool show_manual_login { get { return true; } }
286 public bool lock { get {return false; } }292 public bool lock { get {return false; } }
287 public string default_session { get { return ""; } }293 public string default_session { get { return ""; } }
294 public string? select_user { get { return null; } }
288295
289 LoginMask last_login_mask;296 LoginMask last_login_mask;
290297
291298
=== modified file 'src/PantheonGreeter.vala'
--- src/PantheonGreeter.vala 2015-10-22 15:31:03 +0000
+++ src/PantheonGreeter.vala 2015-10-24 14:26:12 +0000
@@ -219,19 +219,16 @@
219 greeterbox.set_opacity (255);219 greeterbox.set_opacity (255);
220 greeterbox.restore_easing_state ();220 greeterbox.restore_easing_state ();
221221
222 message ("Selecting last used user...");222 var select_user = login_gateway.select_user;
223223 var switch_to_user = (select_user != null) ? select_user : get_greeter_state ("last-user");
224 var last_user = get_greeter_state ("last-user");224
225225 if (switch_to_user != null) {
226 if (last_user == null) {
227 warning ("last user not set");
228 } else {
229 for (var i = 0; i < userlist.size; i++) {226 for (var i = 0; i < userlist.size; i++) {
230 if (userlist.get_user (i).name == last_user) {227 if (userlist.get_user (i).name == switch_to_user) {
231 userlist.current_user = userlist.get_user (i);228 userlist.current_user = userlist.get_user (i);
232 break;229 break;
233 }230 }
234 }231 }
235 }232 }
236233
237 if (userlist.current_user == null)234 if (userlist.current_user == null)

Subscribers

People subscribed via source and target branches