on xenial help sign in
Ignore Home Key presses when the greeter is up.

This avoids pocket presses / dialing on devices like the arale. Fixes: #1565818 Approved by: Daniel d'Andrada

commit119572a042c0e99b4f68572b06cd8b0caa937770 authorMichael Terry <michael.terry@canonical.com> dateWed 27 Apr 2016, 15:00 (10 years ago) parent06a278ca4e4752
2 files changed+18−1
qml/Shell.qml+8−1 tests/qmltests/tst_Shell.qml+10
qml/Shell.qml+8−1
@@ -207,7 +207,14 @@ Item {
207207 }
208208
209209 WindowInputMonitor {
210− onHomeKeyActivated: { launcher.fadeOut(); shell.showHome(); }
210+ objectName: "windowInputMonitor"
211+ onHomeKeyActivated: {
212+ // Ignore when greeter is active, to avoid pocket presses
213+ if (!greeter.active) {
214+ launcher.fadeOut();
215+ shell.showHome();
216+ }
217+ }
211218 onTouchBegun: { cursor.opacity = 0; }
212219 onTouchEnded: {
213220 // move the (hidden) cursor to the last known touch position
tests/qmltests/tst_Shell.qml+10
@@ -1403,6 +1403,16 @@ Rectangle {
14031403 tryCompare(launcherPanel, "x", -launcherPanel.width);
14041404 }
14051405
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+
14061416 function test_tabletLogin_data() {
14071417 return [
14081418 {tag: "auth error", user: "auth-error", loggedIn: false, password: ""},