on xenial help sign in
Ignore home key when greeter is up
commit2007c78eea9de1542ffe664bd9dadfbc74d789bd authorMichael Terry <michael.terry@canonical.com> dateTue 5 Apr 2016, 17:07 (11 years ago) parent8e46b45
2 files changed+18−1
qml/Shell.qml+8−1 tests/qmltests/tst_Shell.qml+10
qml/Shell.qml+8−1
@@ -179,7 +179,14 @@ Item {
179179 }
180180
181181 WindowInputMonitor {
182− onHomeKeyActivated: { launcher.fadeOut(); shell.showHome(); }
182+ objectName: "windowInputMonitor"
183+ onHomeKeyActivated: {
184+ // Don't active when greeter's active, to avoid pocket presses
185+ if (!greeter.active) {
186+ launcher.fadeOut();
187+ shell.showHome();
188+ }
189+ }
183190 onTouchBegun: { cursor.opacity = 0; }
184191 onTouchEnded: {
185192 // move the (hidden) cursor to the last known touch position
tests/qmltests/tst_Shell.qml+10
@@ -1383,6 +1383,16 @@ Rectangle {
13831383 tryCompare(launcherPanel, "x", -launcherPanel.width);
13841384 }
13851385
1386+ function test_physicalHomeKeyPressDoesNothingWithActiveGreeter() {
1387+ loadShell("phone");
1388+
1389+ var windowInputMonitor = findChild(shell, "windowInputMonitor");
1390+ var greeter = findChild(shell, "greeter");
1391+
1392+ windowInputMonitor.homeKeyActivated();
1393+ verify(greeter.shown);
1394+ }
1395+
13861396 function test_tabletLogin_data() {
13871397 return [
13881398 {tag: "auth error", user: "auth-error", loggedIn: false, password: ""},