on xenial help sign in
Make the application lose focus while the panel is open.

Make the application lose focus, and as a consequence cause the vkb to close, when you start opening the indicators panel.

commit5a052049f205b5c0ba797bb7c9dd9ada84218b03 authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateWed 23 Jul 2014, 20:41 (12 years ago) parenta79fd1e
3 files changed+46
qml/Panel/Indicators.qml+1 qml/Shell.qml+1 tests/qmltests/tst_Shell.qml+44
qml/Panel/Indicators.qml+1
@@ -37,6 +37,7 @@ Showable {
3737 readonly property int lockThreshold: openedHeight / 2
3838 property bool fullyOpened: height == openedHeight
3939 property bool partiallyOpened: height > panelHeight && !fullyOpened
40+ property bool fullyClosed: height <= panelHeight
4041 property bool contentEnabled: true
4142 property bool initalizeItem: true
4243 readonly property alias content: menuContent
qml/Shell.qml+1
@@ -461,6 +461,7 @@ Item {
461461 target: applicationsDisplayLoader.item
462462 property: "interactive"
463463 value: stages.roughlyFullyShown && !greeter.shown && !lockscreen.shown
464+ && panel.indicators.fullyClosed
464465 }
465466 Binding {
466467 target: applicationsDisplayLoader.item
tests/qmltests/tst_Shell.qml+44
@@ -378,6 +378,38 @@ Item {
378378 tryCompare(item, "visible", false);
379379 }
380380
381+ function test_surfaceLosesFocusWhilePanelIsOpen() {
382+ var app = ApplicationManager.startApplication("dialer-app");
383+ // wait until the app is fully loaded (ie, real surface replaces splash screen)
384+ tryCompareFunction(function() { return app.surface != null }, true);
385+
386+ tryCompare(app.surface, "focus", true);
387+
388+ // Drag the indicators panel half-open
389+ var touchX = shell.width / 2;
390+ var indicators = findChild(shell, "indicators");
391+ touchFlick(indicators,
392+ touchX /* fromX */, indicators.panelHeight * 0.5 /* fromY */,
393+ touchX /* toX */, shell.height * 0.5 /* toY */,
394+ true /* beginTouch */, false /* endTouch */);
395+ verify(indicators.partiallyOpened);
396+
397+ tryCompare(app.surface, "focus", false);
398+
399+ // And finish getting it open
400+ touchFlick(indicators,
401+ touchX /* fromX */, shell.height * 0.5 /* fromY */,
402+ touchX /* toX */, shell.height * 0.9 /* toY */,
403+ false /* beginTouch */, true /* endTouch */);
404+ tryCompare(indicators, "fullyOpened", true);
405+
406+ tryCompare(app.surface, "focus", false);
407+
408+ dragToCloseIndicatorsPanel();
409+
410+ tryCompare(app.surface, "focus", true);
411+ }
412+
381413 // Wait for the whole UI to settle down
382414 function waitForUIToSettle() {
383415 waitUntilApplicationWindowIsFullyHidden();
@@ -385,6 +417,18 @@ Item {
385417 tryCompare(dashContentList, "moving", false);
386418 }
387419
420+ function dragToCloseIndicatorsPanel() {
421+ var indicators = findChild(shell, "indicators");
422+
423+ var touchStartX = shell.width / 2;
424+ var touchStartY = shell.height - (indicators.panelHeight * 0.5);
425+ touchFlick(shell,
426+ touchStartX, touchStartY,
427+ touchStartX, shell.height * 0.1);
428+
429+ tryCompare(indicators, "fullyClosed", true);
430+ }
431+
388432 function dragLauncherIntoView() {
389433 var launcherPanel = findChild(shell, "launcherPanel");
390434 verify(launcherPanel.x = - launcherPanel.width);