on xenial help sign in
fix restoring windows back to their normal x/y from semi-maximized
3da58cfLukáš Tinkl
qml/Stage/WindowResizeArea.qml+6−2
@@ -56,11 +56,16 @@ MouseArea {
56 property int normalHeight: 0
56 property int normalHeight: 0
57
57
58 function updateNormalGeometry() {
58 function updateNormalGeometry() {
59− if (root.target.state == "normal" || root.target.state == "restored") {
59+ if (root.target.state == "normal") {
60 normalX = root.target.requestedX
60 normalX = root.target.requestedX
61 normalY = root.target.requestedY
61 normalY = root.target.requestedY
62 normalWidth = root.target.width
62 normalWidth = root.target.width
63 normalHeight = root.target.height
63 normalHeight = root.target.height
64+ } else if (root.target.state == "restored") {
65+ normalX = root.target.restoredX
66+ normalY = root.target.restoredY
67+ normalWidth = root.target.width
68+ normalHeight = root.target.height
64 }
69 }
65 }
70 }
66 }
71 }
@@ -77,7 +82,6 @@ MouseArea {
77 var windowGeometry = windowStateStorage.getGeometry(root.windowId,
82 var windowGeometry = windowStateStorage.getGeometry(root.windowId,
78 Qt.rect(target.windowedX, target.windowedY, defaultWidth, defaultHeight));
83 Qt.rect(target.windowedX, target.windowedY, defaultWidth, defaultHeight));
79
84
80−
81 target.windowedWidth = Qt.binding(function() { return Math.min(Math.max(windowGeometry.width, d.minimumWidth), screenWidth - root.leftMargin); });
85 target.windowedWidth = Qt.binding(function() { return Math.min(Math.max(windowGeometry.width, d.minimumWidth), screenWidth - root.leftMargin); });
82 target.windowedHeight = Qt.binding(function() { return Math.min(Math.max(windowGeometry.height, d.minimumHeight),
86 target.windowedHeight = Qt.binding(function() { return Math.min(Math.max(windowGeometry.height, d.minimumHeight),
83 root.screenHeight - (target.fullscreen ? 0 : PanelState.panelHeight)); });
87 root.screenHeight - (target.fullscreen ? 0 : PanelState.panelHeight)); });