on xenial help sign in
Enable the greeter to remember which session the user last logged into

This also fixes a small issue with how the default session was handled. (LP: #1631365) Approved by: Albert Astals Cid, Unity8 CI Bot

commiteffea56b7f66f5703c60a355fb772e4df2861141 authorJosh Arenson <joshua.arenson@canonical.com> dateWed 7 Dec 2016, 13:45 (10 years ago) parent9515b335ab0572
3 files changed+9−8
qml/Greeter/Greeter.qml+1−5 qml/Greeter/LoginList.qml+1−1 qml/Greeter/WideView.qml+7−2
qml/Greeter/Greeter.qml+1−5
@@ -145,11 +145,7 @@ Showable {
145145 }
146146 }
147147
148− if (loader.item.sessionToStart === LightDMService.greeter.defaultSession) {
149− return LightDMService.greeter.defaultSession;
150− } else {
151− return "ubuntu"; // The default / fallback
152− }
148+ return LightDMService.greeter.defaultSession;
153149 }
154150
155151 QtObject {
qml/Greeter/LoginList.qml+1−1
@@ -165,7 +165,7 @@ StyledItem {
165165 }
166166
167167 delegate: Item {
168− width: parent.width
168+ width: userList.width
169169 height: root.cellHeight
170170
171171 readonly property bool belowHighlight: (userList.currentIndex < 0 && index > 0) || (userList.currentIndex >= 0 && index > userList.currentIndex)
qml/Greeter/WideView.qml+7−2
@@ -125,6 +125,8 @@ FocusScope {
125125 id: loginList
126126 objectName: "loginList"
127127
128+ property int selectedUserIndex: 0
129+
128130 width: units.gu(40)
129131 anchors {
130132 left: parent.left
@@ -139,9 +141,12 @@ FocusScope {
139141 Behavior on boxVerticalOffset { UbuntuNumberAnimation {} }
140142
141143 model: root.userModel
142− currentSession: LightDMService.greeter.defaultSession
144+ currentSession: LightDMService.users.data(selectedUserIndex, LightDMService.userRoles.SessionRole);
143145 onResponded: root.responded(response)
144− onSelected: root.selected(index)
146+ onSelected: {
147+ root.selected(index)
148+ loginList.selectedUserIndex = index;
149+ }
145150 onSessionChooserButtonClicked: parent.state = "SessionsList"
146151
147152 Keys.forwardTo: [sessionChooserLoader.item]