on xenial help sign in
Ignore Home Key presses when the greeter is up.
119572aMichael Terry
qml/Shell.qml+8−1
@@ -207,7 +207,14 @@ Item {
207 }
207 }
208
208
209 WindowInputMonitor {
209 WindowInputMonitor {
210+ objectName: "windowInputMonitor"
210− onHomeKeyActivated: { launcher.fadeOut(); shell.showHome(); }
211+ onHomeKeyActivated: {
212+ // Ignore when greeter is active, to avoid pocket presses
213+ if (!greeter.active) {
214+ launcher.fadeOut();
215+ shell.showHome();
216+ }
217+ }
211 onTouchBegun: { cursor.opacity = 0; }
218 onTouchBegun: { cursor.opacity = 0; }
212 onTouchEnded: {
219 onTouchEnded: {
213 // move the (hidden) cursor to the last known touch position
220 // move the (hidden) cursor to the last known touch position
tests/qmltests/tst_Shell.qml+10
@@ -1403,6 +1403,16 @@ Rectangle {
1403 tryCompare(launcherPanel, "x", -launcherPanel.width);
1403 tryCompare(launcherPanel, "x", -launcherPanel.width);
1404 }
1404 }
1405
1405
1406+ function test_physicalHomeKeyPressDoesNothingWithActiveGreeter() {
1407+ loadShell("phone");
1408+
1409+ var windowInputMonitor = findInvisibleChild(shell, "windowInputMonitor");
1410+ var coverPage = findChild(shell, "coverPage");
1411+
1412+ windowInputMonitor.homeKeyActivated();
1413+ verify(coverPage.shown);
1414+ }
1415+
1406 function test_tabletLogin_data() {
1416 function test_tabletLogin_data() {
1407 return [
1417 return [
1408 {tag: "auth error", user: "auth-error", loggedIn: false, password: ""},
1418 {tag: "auth error", user: "auth-error", loggedIn: false, password: ""},