@@ -38,7 +38,6 @@ import Unity.Indicators 0.1 as Indicators
39import "../../qml"
39import "../../qml"
40import "../../qml/Components"
40import "../../qml/Components"
41−import "../../qml/Components/PanelState"
42import "Stage"
41import "Stage"
44Rectangle {
43Rectangle {
@@ -57,19 +56,16 @@ Rectangle {
57 id: appMenuData
56 id: appMenuData
60− property var shell: shellLoader.item ? shellLoader.item : null
59+ readonly property var shell: shellLoader.item ? shellLoader.item : null
61 onShellChanged: {
60 onShellChanged: {
62 if (shell) {
61 if (shell) {
63− topLevelSurfaceList = shell.topLevelSurfaceList;
64 panelState = testCase.findInvisibleChild(shell, "panelState");
62 panelState = testCase.findInvisibleChild(shell, "panelState");
66− topLevelSurfaceList = null;
64+ panelState = null;
67− panelState = undefined;
71− property var topLevelSurfaceList: null
67+ property var panelState: null
72− property var panelState: undefined
68+ readonly property alias topLevelSurfaceList: testCase.topLevelSurfaceList
74 QtObject {
70 QtObject {
75 id: _screenWindow
71 id: _screenWindow
@@ -569,6 +565,7 @@ Rectangle {
569 when: windowShown
565 when: windowShown
571 property Item shell: shellLoader.status === Loader.Ready ? shellLoader.item : null
567 property Item shell: shellLoader.status === Loader.Ready ? shellLoader.item : null
568+ topLevelSurfaceList: shell ? shell.topLevelSurfaceList : null
573 function init() {
570 function init() {
574 if (shellLoader.active) {
571 if (shellLoader.active) {
@@ -607,7 +604,6 @@ Rectangle {
607 waitForGreeterToStabilize();
604 waitForGreeterToStabilize();
609 // from StageTestCase
606 // from StageTestCase
610− topLevelSurfaceList = shell.topLevelSurfaceList;
611 verify(topLevelSurfaceList);
607 verify(topLevelSurfaceList);
612 stage = findChild(shell, "stage");
608 stage = findChild(shell, "stage");
@@ -2659,9 +2655,9 @@ Rectangle {
2660 function test_oskDisplacesWindow_data() {
2656 function test_oskDisplacesWindow_data() {
2661 return [
2657 return [
2662− {tag: "no need to displace", windowHeight: units.gu(10), windowY: units.gu(5), targetDisplacement: units.gu(5), oskEnabled: true},
2658+ {tag: "no need to displace", windowHeight: units.gu(10), windowY: units.gu(5), targetDisplacement: function() { return units.gu(5); }, oskEnabled: true},
2663− {tag: "displace to top", windowHeight: units.gu(50), windowY: units.gu(10), targetDisplacement: panelState.panelHeight, oskEnabled: true},
2659+ {tag: "displace to top", windowHeight: units.gu(50), windowY: units.gu(10), targetDisplacement: function() { return panelState.panelHeight; }, oskEnabled: true},
2664− {tag: "osk not on this screen", windowHeight: units.gu(40), windowY: units.gu(10), targetDisplacement: units.gu(10), oskEnabled: false},
2660+ {tag: "osk not on this screen", windowHeight: units.gu(40), windowY: units.gu(10), targetDisplacement: function() { return units.gu(10); }, oskEnabled: false},
@@ -2687,7 +2683,7 @@ Rectangle {
2687 verify(initialY > panelState.panelHeight);
2683 verify(initialY > panelState.panelHeight);
2689 topLevelSurfaceList.inputMethodSurface.setInputBounds(Qt.rect(0, root.height / 2, root.width, root.height / 2));
2685 topLevelSurfaceList.inputMethodSurface.setInputBounds(Qt.rect(0, root.height / 2, root.width, root.height / 2));
2690− tryCompare(dashAppDelegate, "y", data.targetDisplacement);
2686+ tryCompare(dashAppDelegate, "y", data.targetDisplacement());
2692 topLevelSurfaceList.inputMethodSurface.setInputBounds(Qt.rect(0, 0, 0, 0));
2688 topLevelSurfaceList.inputMethodSurface.setInputBounds(Qt.rect(0, 0, 0, 0));
2693 tryCompare(dashAppDelegate, "y", initialY);
2689 tryCompare(dashAppDelegate, "y", initialY);
@@ -3120,7 +3116,7 @@ Rectangle {
3120 // double click the panel
3116 // double click the panel
3121 var panel = findChild(shell, "panel");
3117 var panel = findChild(shell, "panel");
3122 verify(panel);
3118 verify(panel);
3123− mouseDoubleClickSequence(panel, panel.width/2, PanelState.panelHeight/2, Qt.LeftButton, Qt.NoModifier, 300);
3119+ mouseDoubleClickSequence(panel, panel.width/2, panelState.panelHeight/2, Qt.LeftButton, Qt.NoModifier, 300);
3124 tryCompare(appDelegate, "state", "restored");
3120 tryCompare(appDelegate, "state", "restored");