on xenial help sign in
fix initialisation of window storage state for new apps/windows
a98265cMichael Zanetti
qml/Stages/DesktopStage.qml+1
@@ -219,6 +219,7 @@ Rectangle {
219 }
219 }
220
220
221 WindowResizeArea {
221 WindowResizeArea {
222+ objectName: "windowResizeArea"
222 target: appDelegate
223 target: appDelegate
223 minWidth: units.gu(10)
224 minWidth: units.gu(10)
224 minHeight: units.gu(10)
225 minHeight: units.gu(10)
qml/Stages/WindowResizeArea.qml+2
@@ -38,6 +38,7 @@ MouseArea {
38
38
39 QtObject {
39 QtObject {
40 id: priv
40 id: priv
41+ objectName: "priv"
41
42
42 property int normalX: 0
43 property int normalX: 0
43 property int normalY: 0
44 property int normalY: 0
@@ -74,6 +75,7 @@ MouseArea {
74 if (windowState === WindowStateStorage.WindowStateMaximized) {
75 if (windowState === WindowStateStorage.WindowStateMaximized) {
75 target.maximize(false)
76 target.maximize(false)
76 }
77 }
78+ priv.updateNormalGeometry();
77 }
79 }
78
80
79 Component.onDestruction: {
81 Component.onDestruction: {
tests/qmltests/tst_Shell.qml+16−2
@@ -1720,11 +1720,9 @@ Rectangle {
1720 var appDelegate = appRepeater.itemAt(0);
1720 var appDelegate = appRepeater.itemAt(0);
1721 var maximizeButton = findChild(appDelegate, "maximizeWindowButton");
1721 var maximizeButton = findChild(appDelegate, "maximizeWindowButton");
1722
1722
1723− wait(5000)
1724 tryCompare(appDelegate, "state", "normal");
1723 tryCompare(appDelegate, "state", "normal");
1725 tryCompare(PanelState, "buttonsVisible", false)
1724 tryCompare(PanelState, "buttonsVisible", false)
1726
1725
1727− wait(5000)
1728 mouseClick(maximizeButton, maximizeButton.width / 2, maximizeButton.height / 2);
1726 mouseClick(maximizeButton, maximizeButton.width / 2, maximizeButton.height / 2);
1729 tryCompare(appDelegate, "state", "maximized");
1727 tryCompare(appDelegate, "state", "maximized");
1730 tryCompare(PanelState, "buttonsVisible", true)
1728 tryCompare(PanelState, "buttonsVisible", true)
@@ -1736,6 +1734,22 @@ Rectangle {
1736 tryCompare(PanelState, "buttonsVisible", true)
1734 tryCompare(PanelState, "buttonsVisible", true)
1737 }
1735 }
1738
1736
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+
1739 // bug http://pad.lv/1431566
1753 // bug http://pad.lv/1431566
1740 function test_switchToStagedHidesPanelButtons() {
1754 function test_switchToStagedHidesPanelButtons() {
1741 loadDesktopShellWithApps();
1755 loadDesktopShellWithApps();