@@ -30,8 +30,8 @@ import "../../../qml/Components/PanelState"
33− width: desktopStageLoader.width + controls.width
33+ width: stageLoader.width + controls.width
34− height: desktopStageLoader.height
34+ height: stageLoader.height
36 property var greeter: { fullyShown: true }
36 property var greeter: { fullyShown: true }
@@ -63,7 +63,7 @@ Item {
66− id: desktopStageLoader
66+ id: stageLoader
67 x: ((root.width - controls.width) - width) / 2
67 x: ((root.width - controls.width) - width) / 2
68 y: (root.height - height) / 2
68 y: (root.height - height) / 2
69 width: units.gu(160*0.9)
69 width: units.gu(160*0.9)
@@ -82,17 +82,19 @@ Item {
82 edgeBarrierControls.target = testCase.findChild(this, "edgeBarrierController");
82 edgeBarrierControls.target = testCase.findChild(this, "edgeBarrierController");
84 Component.onDestruction: {
84 Component.onDestruction: {
85− desktopStageLoader.itemDestroyed = true;
85+ stageLoader.itemDestroyed = true;
87 orientations: Orientations {}
87 orientations: Orientations {}
88 applicationManager: ApplicationManager
88 applicationManager: ApplicationManager
89 topLevelSurfaceList: topSurfaceList
89 topLevelSurfaceList: topSurfaceList
93 MouseArea {
95 MouseArea {
94 id: clickThroughTester
96 id: clickThroughTester
95− anchors.fill: desktopStageLoader.item
97+ anchors.fill: stageLoader.item
96 acceptedButtons: Qt.AllButtons
98 acceptedButtons: Qt.AllButtons
97 hoverEnabled: true
99 hoverEnabled: true
@@ -130,7 +132,7 @@ Item {
130 id: edgeBarrierControls
132 id: edgeBarrierControls
131 text: "Drag here to pull out spread"
133 text: "Drag here to pull out spread"
132 backgroundColor: "blue"
134 backgroundColor: "blue"
133− onDragged: { desktopStageLoader.item.pushRightEdge(amount); }
135+ onDragged: { stageLoader.item.pushRightEdge(amount); }
136 Divider {}
138 Divider {}
@@ -157,7 +159,7 @@ Item {
157 name: "DesktopStage"
159 name: "DesktopStage"
158 when: windowShown
160 when: windowShown
160− property Item desktopStage: desktopStageLoader.status === Loader.Ready ? desktopStageLoader.item : null
162+ property Item stage: stageLoader.status === Loader.Ready ? stageLoader.item : null
162 function init() {
164 function init() {
163 // wait until unity8-dash is up and running.
165 // wait until unity8-dash is up and running.
@@ -173,29 +175,29 @@ Item {
175 function cleanup() {
177 function cleanup() {
176− desktopStageLoader.itemDestroyed = false;
178+ stageLoader.itemDestroyed = false;
177− desktopStageLoader.active = false;
179+ stageLoader.active = false;
179− tryCompare(desktopStageLoader, "status", Loader.Null);
181+ tryCompare(stageLoader, "status", Loader.Null);
180− tryCompare(desktopStageLoader, "item", null);
182+ tryCompare(stageLoader, "item", null);
181 // Loader.status might be Loader.Null and Loader.item might be null but the Loader
183 // Loader.status might be Loader.Null and Loader.item might be null but the Loader
182 // actually took place. Likely because Loader waits until the next event loop
184 // actually took place. Likely because Loader waits until the next event loop
183 // iteration to do its work. So to ensure the reload, we will wait until the
185 // iteration to do its work. So to ensure the reload, we will wait until the
184 // Shell instance gets destroyed.
186 // Shell instance gets destroyed.
185− tryCompare(desktopStageLoader, "itemDestroyed", true);
187+ tryCompare(stageLoader, "itemDestroyed", true);
187 killApps();
189 killApps();
189 root.resetGeometry();
191 root.resetGeometry();
191− desktopStageLoader.active = true;
193+ stageLoader.active = true;
192− tryCompare(desktopStageLoader, "status", Loader.Ready);
194+ tryCompare(stageLoader, "status", Loader.Ready);
194 mouseEaterSpy.clear();
196 mouseEaterSpy.clear();
197 function waitUntilAppSurfaceShowsUp(surfaceId) {
199 function waitUntilAppSurfaceShowsUp(surfaceId) {
198− var appDelegate = findChild(desktopStage, "appDelegate_" + surfaceId);
200+ var appDelegate = findChild(stage, "appDelegate_" + surfaceId);
199 verify(appDelegate);
201 verify(appDelegate);
200 var appWindow = findChild(appDelegate, "appWindow");
202 var appWindow = findChild(appDelegate, "appWindow");
201 verify(appWindow);
203 verify(appWindow);
@@ -213,7 +215,7 @@ Item {
213 if (app) {
215 if (app) {
214 for (var i = 0; i < topSurfaceList.count; i++) {
216 for (var i = 0; i < topSurfaceList.count; i++) {
215 if (topSurfaceList.applicationAt(i).appId === appId) {
217 if (topSurfaceList.applicationAt(i).appId === appId) {
216− var appRepeater = findChild(desktopStage, "appRepeater");
218+ var appRepeater = findChild(stage, "appRepeater");
217 verify(appRepeater);
219 verify(appRepeater);
218 return appRepeater.itemAt(i);
220 return appRepeater.itemAt(i);
@@ -226,7 +228,7 @@ Item {
226 waitUntilAppSurfaceShowsUp(surfaceId);
228 waitUntilAppSurfaceShowsUp(surfaceId);
227 compare(app.surfaceList.count, 1);
229 compare(app.surfaceList.count, 1);
229− return findChild(desktopStage, "appDelegate_" + surfaceId);
231+ return findChild(stage, "appDelegate_" + surfaceId);
230 } catch(err) {
232 } catch(err) {
231 throw new Error("startApplication("+appId+") called from line " + util.callerLine(1) + " failed!");
233 throw new Error("startApplication("+appId+") called from line " + util.callerLine(1) + " failed!");
@@ -324,7 +326,7 @@ Item {
326 function findDecoratedWindow(surfaceId) {
328 function findDecoratedWindow(surfaceId) {
327− var appDelegate = findChild(desktopStage, "appDelegate_" + surfaceId);
329+ var appDelegate = findChild(stage, "appDelegate_" + surfaceId);
328 if (!appDelegate) {
330 if (!appDelegate) {
329 console.warn("Could not find appDelegate for surfaceId="+surfaceId);
331 console.warn("Could not find appDelegate for surfaceId="+surfaceId);
330 return null;
332 return null;
@@ -333,7 +335,7 @@ Item {
335 function findWindowDecoration(surfaceId) {
337 function findWindowDecoration(surfaceId) {
336− var appDelegate = findChild(desktopStage, "appDelegate_" + surfaceId);
338+ var appDelegate = findChild(stage, "appDelegate_" + surfaceId);
337 if (!appDelegate) {
339 if (!appDelegate) {
338 console.warn("Could not find appDelegate for surfaceId="+surfaceId);
340 console.warn("Could not find appDelegate for surfaceId="+surfaceId);
339 return null;
341 return null;
@@ -465,8 +467,8 @@ Item {
466 mouseClick(dialerDelegate);
468 mouseClick(dialerDelegate);
468− var desktopStagePriv = findInvisibleChild(desktopStage, "DesktopStagePrivate");
470+ var stagePriv = findInvisibleChild(stage, "DesktopStagePrivate");
469− tryCompare(desktopStagePriv, "focusedAppDelegate", dialerDelegate);
471+ tryCompare(stagePriv, "focusedAppDelegate", dialerDelegate);
471 keyClick(Qt.Key_F4, Qt.AltModifier); // Alt+F4 shortcut to close
473 keyClick(Qt.Key_F4, Qt.AltModifier); // Alt+F4 shortcut to close
@@ -527,7 +529,7 @@ Item {
529 function test_oskDisplacesWindow(data) {
531 function test_oskDisplacesWindow(data) {
530− desktopStageLoader.item.oskEnabled = data.oskEnabled
532+ stageLoader.item.oskEnabled = data.oskEnabled
531 var dashAppDelegate = startApplication("unity8-dash");
533 var dashAppDelegate = startApplication("unity8-dash");
532 var oldOSKState = SurfaceManager.inputMethodSurface.state;
534 var oldOSKState = SurfaceManager.inputMethodSurface.state;
533 SurfaceManager.inputMethodSurface.state = Mir.RestoredState;
535 SurfaceManager.inputMethodSurface.state = Mir.RestoredState;
@@ -598,6 +600,8 @@ Item {
598 var gmailDelegate = startApplication("gmail-webapp");
600 var gmailDelegate = startApplication("gmail-webapp");
599 verify(gmailDelegate);
601 verify(gmailDelegate);
601 var gmailMaximizeButton = findChild(gmailDelegate, "maximizeWindowButton");
605 var gmailMaximizeButton = findChild(gmailDelegate, "maximizeWindowButton");
602 verify(gmailMaximizeButton);
606 verify(gmailMaximizeButton);
603 mouseClick(gmailMaximizeButton);
607 mouseClick(gmailMaximizeButton);
@@ -610,6 +614,7 @@ Item {
610 tryCompare(mapApp.surfaceList.get(0), "visible", false);
614 tryCompare(mapApp.surfaceList.get(0), "visible", false);
612 ApplicationManager.stopApplication("gmail-webapp");
616 ApplicationManager.stopApplication("gmail-webapp");
614 tryCompare(mapApp.surfaceList.get(0), "visible", true);
619 tryCompare(mapApp.surfaceList.get(0), "visible", true);
615 tryCompare(dialerApp.surfaceList.get(0), "visible", true);
620 tryCompare(dialerApp.surfaceList.get(0), "visible", true);
@@ -709,7 +714,7 @@ Item {
709 tryCompare(overlay, "visible", data.result);
714 tryCompare(overlay, "visible", data.result);
711 if (data.result) { // if shown, try to hide it by clicking outside
716 if (data.result) { // if shown, try to hide it by clicking outside
712− mouseClick(desktopStage);
717+ mouseClick(stage);
713 tryCompare(overlay, "visible", false);
718 tryCompare(overlay, "visible", false);
@@ -768,24 +773,6 @@ Item {
768 tryCompareFunction(function(){return posBefore == posAfter;}, data.button !== Qt.LeftButton ? true : false);
773 tryCompareFunction(function(){return posBefore == posAfter;}, data.button !== Qt.LeftButton ? true : false);
771− function test_preventMouseEventsThruDesktopSpread() {
772− var spread = findChild(desktopStage, "spread");
775− tryCompareFunction( function(){ return spread.ready }, true );
777− mouseEaterSpy.signalName = "wheel";
778− mouseWheel(spread, spread.width/2, spread.height/2, 10, 10);
779− tryCompare(mouseEaterSpy, "count", 0);
781− mouseEaterSpy.clear();
782− mouseEaterSpy.signalName = "clicked";
783− mouseClick(spread, spread.width/2, spread.height/2, Qt.RightButton);
784− tryCompare(mouseEaterSpy, "count", 0);
789 function test_eatWindowDecorationMouseEvents_data() {
776 function test_eatWindowDecorationMouseEvents_data() {
791 {tag: "left mouse click", signalName: "clicked", button: Qt.LeftButton },
778 {tag: "left mouse click", signalName: "clicked", button: Qt.LeftButton },