on xenial help sign in
Update current session after changing the user

This matches unity7 greeter behaviour, i.e. if you change the session and then change the user, the session that shows up is the last session that new user logged in and not the new session you selected in the previous user Approved by: Josh Arenson, Unity8 CI Bot

commitf11b59ca04de8ca265221f094cb90188530c332c authorAlbert Astals Cid <albert.astals@canonical.com> dateTue 24 Jan 2017, 07:40 (10 years ago) parent6d9907e825ee37
2 files changed+11−4
qml/Greeter/LoginList.qml+6−2 tests/qmltests/Greeter/tst_WideView.qml+5−2
qml/Greeter/LoginList.qml+6−2
@@ -60,11 +60,15 @@ StyledItem {
6060 }
6161
6262 Keys.onUpPressed: {
63− selected(currentIndex - 1);
63+ if (currentIndex > 0) {
64+ selected(currentIndex - 1);
65+ }
6466 event.accepted = true;
6567 }
6668 Keys.onDownPressed: {
67− selected(currentIndex + 1);
69+ if (currentIndex + 1 < model.count) {
70+ selected(currentIndex + 1);
71+ }
6872 event.accepted = true;
6973 }
7074 Keys.onEscapePressed: {
tests/qmltests/Greeter/tst_WideView.qml+5−2
@@ -703,12 +703,15 @@ StyledItem {
703703
704704 function test_loginListMovement_data() {
705705 return [
706− {tag: "up", key: Qt.Key_Up, result: -1},
707− {tag: "down", key: Qt.Key_Down, result: 1},
706+ {tag: "up", key: Qt.Key_Up, result: 1},
707+ {tag: "down", key: Qt.Key_Down, result: 3},
708708 ]
709709 }
710710
711711 function test_loginListMovement(data) {
712+ selectIndex(2);
713+ selectedSpy.clear();
714+
712715 keyClick(data.key);
713716 compare(selectedSpy.count, 1);
714717 compare(selectedSpy.signalArguments[0][0], data.result);