on xenial help sign in
disallow resizing windows up past the Panel
commitda773c83784e91c5c621d98701d3e93f5fe885c3 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateFri 4 Mar 2016, 12:09 (11 years ago) parentc09b516
2 files changed+26−1
qml/Stages/WindowResizeArea.qml+1−1 tests/qmltests/tst_Shell.qml+25
qml/Stages/WindowResizeArea.qml+1−1
@@ -298,7 +298,7 @@ MouseArea {
298298 }
299299
300300 if (d.topBorder) {
301− var newTargetY = d.startY + deltaY;
301+ var newTargetY = Math.max(d.startY + deltaY, PanelState.panelHeight); // disallow resizing up past Panel
302302 var bottomBorderY = target.y + target.height;
303303 if (bottomBorderY > newTargetY + d.minimumHeight) {
304304 if (bottomBorderY < newTargetY + d.maximumHeight) {
tests/qmltests/tst_Shell.qml+25
@@ -1854,6 +1854,31 @@ Rectangle {
18541854 compare(appDelegate.y >= PanelState.panelHeight, true);
18551855 }
18561856
1857+ function test_cantResizeWindowUnderPanel() {
1858+ loadShell("desktop");
1859+ shell.usageScenario = "desktop";
1860+ waitForRendering(shell);
1861+
1862+ var app = ApplicationManager.startApplication("dialer-app")
1863+ waitUntilAppWindowIsFullyLoaded(app);
1864+
1865+ var appContainer = findChild(shell, "appContainer");
1866+ var appDelegate = findChild(appContainer, "appDelegate_dialer-app");
1867+ var decoration = findChild(appDelegate, "appWindowDecoration_dialer-app");
1868+ verify(decoration);
1869+
1870+ // move it away from launcher and panel
1871+ appDelegate.x = units.gu(10)
1872+ appDelegate.y = units.gu(10)
1873+
1874+ // drag-resize the area up
1875+ mousePress(decoration, decoration.width/2, -units.gu(1));
1876+ mouseMove(decoration, decoration.width/2, -units.gu(100));
1877+
1878+ // verify we don't go past the panel
1879+ compare(appDelegate.y >= PanelState.panelHeight, true);
1880+ }
1881+
18571882 function test_restoreWindowStateFixesIfUnderPanel() {
18581883 loadDesktopShellWithApps();
18591884 var appRepeater = findChild(shell, "appRepeater")