on xenial help sign in
merge prereq
ab99303Michael Zanetti
qml/Launcher/Launcher.qml+5−1
@@ -142,7 +142,6 @@ FocusScope {
142 panel.highlightIndex = -1; // The BFB
142 panel.highlightIndex = -1; // The BFB
143 root.focus = true;
143 root.focus = true;
144 switchToNextState("visible")
144 switchToNextState("visible")
145− root.focus = true;
146 }
145 }
147
146
148 Keys.onPressed: {
147 Keys.onPressed: {
@@ -381,6 +380,11 @@ FocusScope {
381 }
380 }
382 }
381 }
383
382
383+ onKbdNavigationCancelled: {
384+ root.state = "";
385+ root.focus = false;
386+ }
387+
384 Behavior on x {
388 Behavior on x {
385 enabled: !dragArea.dragging && !launcherDragArea.drag.active && panel.animate;
389 enabled: !dragArea.dragging && !launcherDragArea.drag.active && panel.animate;
386 NumberAnimation {
390 NumberAnimation {
qml/Launcher/LauncherPanel.qml+7−1
@@ -40,6 +40,7 @@ Rectangle {
40
40
41 signal applicationSelected(string appId)
41 signal applicationSelected(string appId)
42 signal showDashHome()
42 signal showDashHome()
43+ signal kbdNavigationCancelled()
43
44
44 onXChanged: {
45 onXChanged: {
45 if (quickList.state == "open") {
46 if (quickList.state == "open") {
@@ -661,7 +662,10 @@ Rectangle {
661 enabled: quickList.state == "open" || pressed
662 enabled: quickList.state == "open" || pressed
662
663
663 onClicked: {
664 onClicked: {
664− quickList.state = ""
665+ quickList.state = "";
666+ quickList.focus = false;
667+ root.highlightIndex = -2;
668+ root.kbdNavigationCancelled();
665 }
669 }
666
670
667 // Forward for dragging to work when quickList is open
671 // Forward for dragging to work when quickList is open
@@ -788,6 +792,8 @@ Rectangle {
788 // Unsetting model to prevent showing changing entries during fading out
792 // Unsetting model to prevent showing changing entries during fading out
789 // that may happen because of triggering an action.
793 // that may happen because of triggering an action.
790 LauncherModel.quickListActionInvoked(quickList.appId, index);
794 LauncherModel.quickListActionInvoked(quickList.appId, index);
795+ quickList.focus = false;
796+ root.kbdNavigationCancelled();
791 quickList.model = undefined;
797 quickList.model = undefined;
792 }
798 }
793 }
799 }
tests/qmltests/Launcher/tst_Launcher.qml+25−3
@@ -1179,9 +1179,9 @@ Item {
1179
1179
1180 function test_hideNotWorkingWhenLockedOut_data() {
1180 function test_hideNotWorkingWhenLockedOut_data() {
1181 return [
1181 return [
1182− {tag: "locked visible", locked: true},
1182+ {tag: "locked visible", locked: true},
1183− {tag: "no locked visible", locked: false},
1183+ {tag: "no locked visible", locked: false},
1184− ]
1184+ ]
1185 }
1185 }
1186
1186
1187 function test_hideNotWorkingWhenLockedOut(data) {
1187 function test_hideNotWorkingWhenLockedOut(data) {
@@ -1200,5 +1200,27 @@ Item {
1200 verify(launcher.state == "");
1200 verify(launcher.state == "");
1201 }
1201 }
1202 }
1202 }
1203+
1204+ function test_cancelKbdNavigationWitMouse() {
1205+ launcher.openForKeyboardNavigation();
1206+ waitForRendering(launcher);
1207+
1208+ var launcherPanel = findChild(launcher, "launcherPanel");
1209+ tryCompare(launcherPanel, "x", 0);
1210+
1211+ var quickList = findChild(launcher, "quickList");
1212+
1213+ keyClick(Qt.Key_Down); // Down to launcher item 0
1214+ keyClick(Qt.Key_Down); // Down to launcher item 1
1215+ keyClick(Qt.Key_Right); // Into quicklist
1216+
1217+ waitForRendering(launcher)
1218+ tryCompare(quickList, "visible", true)
1219+
1220+ mouseClick(root, root.width / 2, units.gu(2));
1221+
1222+ tryCompare(launcher, "state", "");
1223+ tryCompare(launcherPanel, "highlightIndex", -2);
1224+ }
1203 }
1225 }
1204}
1226}