on xenial help sign in
Fix PhoneStage issue with new app coming while in spread
commita8f73c810144f14ce17aa285eefd31a81dff2368 authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateTue 5 Apr 2016, 11:36 (11 years ago) parent6fb9fec
2 files changed+18−7
qml/Stages/PhoneStage.qml+1−7 tests/qmltests/Stages/tst_PhoneStage.qml+17
qml/Stages/PhoneStage.qml+1−7
@@ -462,12 +462,6 @@ AbstractStage {
462462 objectName: "spreadRepeater"
463463 model: topLevelSurfaceList
464464
465− onItemAdded: {
466− if (spreadView.phase == 2) {
467− spreadView.snapTo(spreadRepeater.count - 1);
468− }
469− }
470−
471465 onItemRemoved: {
472466 // Unless we're closing the app ourselves in the spread,
473467 // lets make sure the spread doesn't mess up by the changing app list.
@@ -517,7 +511,7 @@ AbstractStage {
517511 // new items are appended and must be manually brought to front.
518512 // that's how it *must* be in order to get the animation for new
519513 // surfaces working
520− focus = true;
514+ claimFocus();
521515 }
522516 }
523517
tests/qmltests/Stages/tst_PhoneStage.qml+17
@@ -649,5 +649,22 @@ Item {
649649 // only unity8-dash surface is left
650650 compare(topLevelSurfaceList.count, 1);
651651 }
652+
653+
654+ /*
655+ Check that when an application starts while the spread is open, the
656+ spread closes and that new app is brought to front (gets focused).
657+ */
658+ function test_launchAppWithSpreadOpen()
659+ {
660+ performEdgeSwipeToShowAppSpread();
661+
662+ var webbrowserSurfaceId = topLevelSurfaceList.nextId;
663+ var webbrowserApp = ApplicationManager.startApplication("webbrowser-app");
664+ waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
665+
666+ compare(topLevelSurfaceList.idAt(0), webbrowserSurfaceId);
667+ compare(webbrowserApp.focused, true);
668+ }
652669 }
653670}