on xenial help sign in
fix initialisation of window storage state for new apps/windows
commita98265cb4753a75224ab9c6ca62ff20b41a2ac3e authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 29 Oct 2015, 11:34 (11 years ago) parent9a708f4
3 files changed+19−2
qml/Stages/DesktopStage.qml+1 qml/Stages/WindowResizeArea.qml+2 tests/qmltests/tst_Shell.qml+16−2
qml/Stages/DesktopStage.qml+1
@@ -219,6 +219,7 @@ Rectangle {
219219 }
220220
221221 WindowResizeArea {
222+ objectName: "windowResizeArea"
222223 target: appDelegate
223224 minWidth: units.gu(10)
224225 minHeight: units.gu(10)
qml/Stages/WindowResizeArea.qml+2
@@ -38,6 +38,7 @@ MouseArea {
3838
3939 QtObject {
4040 id: priv
41+ objectName: "priv"
4142
4243 property int normalX: 0
4344 property int normalY: 0
@@ -74,6 +75,7 @@ MouseArea {
7475 if (windowState === WindowStateStorage.WindowStateMaximized) {
7576 target.maximize(false)
7677 }
78+ priv.updateNormalGeometry();
7779 }
7880
7981 Component.onDestruction: {
tests/qmltests/tst_Shell.qml+16−2
@@ -1720,11 +1720,9 @@ Rectangle {
17201720 var appDelegate = appRepeater.itemAt(0);
17211721 var maximizeButton = findChild(appDelegate, "maximizeWindowButton");
17221722
1723− wait(5000)
17241723 tryCompare(appDelegate, "state", "normal");
17251724 tryCompare(PanelState, "buttonsVisible", false)
17261725
1727− wait(5000)
17281726 mouseClick(maximizeButton, maximizeButton.width / 2, maximizeButton.height / 2);
17291727 tryCompare(appDelegate, "state", "maximized");
17301728 tryCompare(PanelState, "buttonsVisible", true)
@@ -1736,6 +1734,22 @@ Rectangle {
17361734 tryCompare(PanelState, "buttonsVisible", true)
17371735 }
17381736
1737+ function test_newAppHasValidGeometry() {
1738+ loadDesktopShellWithApps();
1739+ var appRepeater = findChild(shell, "appRepeater");
1740+ var appId = ApplicationManager.get(0).appId;
1741+ var appDelegate = appRepeater.itemAt(0);
1742+
1743+ var resizeArea = findChild(appDelegate, "windowResizeArea");
1744+ var priv = findInvisibleChild(resizeArea, "priv");
1745+
1746+ // Make sure windows are at 0,0 or greater and they have a size that's > 0
1747+ compare(priv.normalX >= 0, true)
1748+ compare(priv.normalY >= 0, true)
1749+ compare(priv.normalWidth > 0, true)
1750+ compare(priv.normalHeight > 0, true)
1751+ }
1752+
17391753 // bug http://pad.lv/1431566
17401754 function test_switchToStagedHidesPanelButtons() {
17411755 loadDesktopShellWithApps();