@@ -332,9 +332,9 @@ Rectangle {
332 var app2 = ApplicationManager.startApplication("webbrowser-app")
332 var app2 = ApplicationManager.startApplication("webbrowser-app")
333 var app3 = ApplicationManager.startApplication("camera-app")
333 var app3 = ApplicationManager.startApplication("camera-app")
334 var app4 = ApplicationManager.startApplication("facebook-webapp")
334 var app4 = ApplicationManager.startApplication("facebook-webapp")
335− var app5 = ApplicationManager.startApplication("calendar-app")
336− var app6 = ApplicationManager.startApplication("gallery-app")
337 var app7 = ApplicationManager.startApplication("camera-app")
335 var app7 = ApplicationManager.startApplication("camera-app")
336+ var app6 = ApplicationManager.startApplication("gallery-app")
337+ var app5 = ApplicationManager.startApplication("calendar-app")
338 waitUntilAppWindowIsFullyLoaded(app7);
338 waitUntilAppWindowIsFullyLoaded(app7);
@@ -1696,11 +1696,11 @@ Rectangle {
1696 keyPress(Qt.Key_Control)
1696 keyPress(Qt.Key_Control)
1697 keyClick(Qt.Key_Tab);
1697 keyClick(Qt.Key_Tab);
1700 tryCompare(desktopSpread, "state", "altTab")
1699 tryCompare(desktopSpread, "state", "altTab")
1702− mouseMove(shell, 0, 0);
1701+ mouseMove(shell, 0, shell.height / 2);
1703 tryCompare(launcher, "state", "visibleTemporary")
1702 tryCompare(launcher, "state", "visibleTemporary")
1703+ waitForRendering(shell)
1705 mouseClick(bfb, bfb.width / 2, bfb.height / 2)
1705 mouseClick(bfb, bfb.width / 2, bfb.height / 2)
1706 tryCompare(launcher, "state", "")
1706 tryCompare(launcher, "state", "")
@@ -1780,5 +1780,36 @@ Rectangle {
1780 waitForRendering(shell);
1780 waitForRendering(shell);
1781 tryCompare(panelButtons, "visible", true);
1781 tryCompare(panelButtons, "visible", true);
1784+ function test_cantMoveWindowUnderPanel() {
1785+ loadDesktopShellWithApps();
1786+ var appRepeater = findChild(shell, "appRepeater")
1787+ var appDelegate = appRepeater.itemAt(0);
1789+ mousePress(appDelegate, appDelegate.width / 2, units.gu(1))
1790+ mouseMove(appDelegate, appDelegate.width / 2, -units.gu(100))
1792+ compare(appDelegate.y >= PanelState.panelHeight, true);
1795+ function test_restoreWindowStateFixesIfUnderPanel() {
1796+ loadDesktopShellWithApps();
1797+ var appRepeater = findChild(shell, "appRepeater")
1798+ var appId = ApplicationManager.get(0).appId;
1799+ var appDelegate = appRepeater.itemAt(0);
1801+ // Move it under the panel programmatically (might happen later with an alt+drag)
1802+ appDelegate.y = -units.gu(10)
1804+ ApplicationManager.stopApplication(appId)
1805+ ApplicationManager.startApplication(appId)
1806+ waitForRendering(shell)
1808+ // Make sure the newly started one is at index 0 again
1809+ tryCompare(ApplicationManager.get(0), "appId", appId);
1811+ appDelegate = appRepeater.itemAt(0);
1812+ compare(appDelegate.y >= PanelState.panelHeight, true);