on xenial help sign in
Make greeter get user's session from LightDM
commit5ab057206199921f61b3ede324a3c26dfc1492cd authorJosh Arenson <joshua.arenson@canonical.com> dateMon 28 Nov 2016, 16:13 (10 years ago) parent87edbad
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: usersList.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]