on xenial help sign in
Disallow resizing windows up, past the Panel Fixes: #1544766
ca45d4fLukáš Tinkl
qml/Stages/WindowResizeArea.qml+1−1
@@ -301,7 +301,7 @@ MouseArea {
301 }
301 }
302
302
303 if (d.topBorder) {
303 if (d.topBorder) {
304− var newTargetY = d.startY + deltaY;
304+ var newTargetY = Math.max(d.startY + deltaY, PanelState.panelHeight); // disallow resizing up past Panel
305 var bottomBorderY = target.y + target.height;
305 var bottomBorderY = target.y + target.height;
306 if (bottomBorderY > newTargetY + d.minimumHeight) {
306 if (bottomBorderY > newTargetY + d.minimumHeight) {
307 if (bottomBorderY < newTargetY + d.maximumHeight) {
307 if (bottomBorderY < newTargetY + d.maximumHeight) {
tests/qmltests/tst_Shell.qml+25
@@ -1879,6 +1879,31 @@ Rectangle {
1879 compare(appDelegate.y >= PanelState.panelHeight, true);
1879 compare(appDelegate.y >= PanelState.panelHeight, true);
1880 }
1880 }
1881
1881
1882+ function test_cantResizeWindowUnderPanel() {
1883+ loadShell("desktop");
1884+ shell.usageScenario = "desktop";
1885+ waitForRendering(shell);
1886+
1887+ var app = ApplicationManager.startApplication("dialer-app")
1888+ waitUntilAppWindowIsFullyLoaded(app);
1889+
1890+ var appContainer = findChild(shell, "appContainer");
1891+ var appDelegate = findChild(appContainer, "appDelegate_dialer-app");
1892+ var decoration = findChild(appDelegate, "appWindowDecoration_dialer-app");
1893+ verify(decoration);
1894+
1895+ // move it away from launcher and panel
1896+ appDelegate.x = units.gu(10)
1897+ appDelegate.y = units.gu(10)
1898+
1899+ // drag-resize the area up
1900+ mousePress(decoration, decoration.width/2, -units.gu(1));
1901+ mouseMove(decoration, decoration.width/2, -units.gu(100));
1902+
1903+ // verify we don't go past the panel
1904+ compare(appDelegate.y >= PanelState.panelHeight, true);
1905+ }
1906+
1882 function test_restoreWindowStateFixesIfUnderPanel() {
1907 function test_restoreWindowStateFixesIfUnderPanel() {
1883 loadDesktopShellWithApps();
1908 loadDesktopShellWithApps();
1884 var appRepeater = findChild(shell, "appRepeater")
1909 var appRepeater = findChild(shell, "appRepeater")