@@ -344,9 +344,9 @@ Rectangle {
344344 var app2 = ApplicationManager.startApplication("webbrowser-app")
345345 var app3 = ApplicationManager.startApplication("camera-app")
346346 var app4 = ApplicationManager.startApplication("facebook-webapp")
347− var app5 = ApplicationManager.startApplication("calendar-app")
347+ var app5 = ApplicationManager.startApplication("camera-app")
348348 var app6 = ApplicationManager.startApplication("gallery-app")
349− var app7 = ApplicationManager.startApplication("camera-app")
349+ var app7 = ApplicationManager.startApplication("calendar-app")
350350 waitUntilAppWindowIsFullyLoaded(app7);
351351 }
352352
@@ -1710,11 +1710,11 @@ Rectangle {
17101710 keyPress(Qt.Key_Control)
17111711 keyClick(Qt.Key_Tab);
17121712
1713−
17141713 tryCompare(desktopSpread, "state", "altTab")
17151714
1716− mouseMove(shell, 0, 0);
1715+ mouseMove(shell, 0, shell.height / 2);
17171716 tryCompare(launcher, "state", "visibleTemporary")
1717+ waitForRendering(shell)
17181718
17191719 mouseClick(bfb, bfb.width / 2, bfb.height / 2)
17201720 tryCompare(launcher, "state", "")
@@ -1809,6 +1809,37 @@ Rectangle {
18091809 tryCompare(panelButtons, "visible", true);
18101810 }
18111811
1812+ function test_cantMoveWindowUnderPanel() {
1813+ loadDesktopShellWithApps();
1814+ var appRepeater = findChild(shell, "appRepeater")
1815+ var appDelegate = appRepeater.itemAt(0);
1816+
1817+ mousePress(appDelegate, appDelegate.width / 2, units.gu(1))
1818+ mouseMove(appDelegate, appDelegate.width / 2, -units.gu(100))
1819+
1820+ compare(appDelegate.y >= PanelState.panelHeight, true);
1821+ }
1822+
1823+ function test_restoreWindowStateFixesIfUnderPanel() {
1824+ loadDesktopShellWithApps();
1825+ var appRepeater = findChild(shell, "appRepeater")
1826+ var appId = ApplicationManager.get(0).appId;
1827+ var appDelegate = appRepeater.itemAt(0);
1828+
1829+ // Move it under the panel programmatically (might happen later with an alt+drag)
1830+ appDelegate.y = -units.gu(10)
1831+
1832+ ApplicationManager.stopApplication(appId)
1833+ ApplicationManager.startApplication(appId)
1834+ waitForRendering(shell)
1835+
1836+ // Make sure the newly started one is at index 0 again
1837+ tryCompare(ApplicationManager.get(0), "appId", appId);
1838+
1839+ appDelegate = appRepeater.itemAt(0);
1840+ compare(appDelegate.y >= PanelState.panelHeight, true);
1841+ }
1842+
18121843 function test_lifecyclePolicyForNonTouchApp_data() {
18131844 return [
18141845 {tag: "phone", formFactor: "phone", usageScenario: "phone"},