on xenial help sign in
Ignore home key when greeter is up
2007c78Michael Terry
qml/Shell.qml+8−1
@@ -179,7 +179,14 @@ Item {
179 }
179 }
180
180
181 WindowInputMonitor {
181 WindowInputMonitor {
182+ objectName: "windowInputMonitor"
182− onHomeKeyActivated: { launcher.fadeOut(); shell.showHome(); }
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+ }
183 onTouchBegun: { cursor.opacity = 0; }
190 onTouchBegun: { cursor.opacity = 0; }
184 onTouchEnded: {
191 onTouchEnded: {
185 // move the (hidden) cursor to the last known touch position
192 // move the (hidden) cursor to the last known touch position
tests/qmltests/tst_Shell.qml+10
@@ -1383,6 +1383,16 @@ Rectangle {
1383 tryCompare(launcherPanel, "x", -launcherPanel.width);
1383 tryCompare(launcherPanel, "x", -launcherPanel.width);
1384 }
1384 }
1385
1385
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+
1386 function test_tabletLogin_data() {
1396 function test_tabletLogin_data() {
1387 return [
1397 return [
1388 {tag: "auth error", user: "auth-error", loggedIn: false, password: ""},
1398 {tag: "auth error", user: "auth-error", loggedIn: false, password: ""},