on xenial help sign in
Disallow resizing windows up, past the Panel Fixes: #1544766

Approved by: Josh Arenson

commitca45d4f32d6a37bc3adabe411048479f11eabc1c authorLukáš Tinkl <lukas.tinkl@canonical.com> dateThu 10 Mar 2016, 22:43 (11 years ago) parentbf3563305b9c1f
2 files changed+26−1
qml/Stages/WindowResizeArea.qml+1−1 tests/qmltests/tst_Shell.qml+25
qml/Stages/WindowResizeArea.qml+1−1
@@ -301,7 +301,7 @@ MouseArea {
301301 }
302302
303303 if (d.topBorder) {
304− var newTargetY = d.startY + deltaY;
304+ var newTargetY = Math.max(d.startY + deltaY, PanelState.panelHeight); // disallow resizing up past Panel
305305 var bottomBorderY = target.y + target.height;
306306 if (bottomBorderY > newTargetY + d.minimumHeight) {
307307 if (bottomBorderY < newTargetY + d.maximumHeight) {
tests/qmltests/tst_Shell.qml+25
@@ -1879,6 +1879,31 @@ Rectangle {
18791879 compare(appDelegate.y >= PanelState.panelHeight, true);
18801880 }
18811881
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+
18821907 function test_restoreWindowStateFixesIfUnderPanel() {
18831908 loadDesktopShellWithApps();
18841909 var appRepeater = findChild(shell, "appRepeater")