on xenial help sign in
address review comments
54c2246Lukáš Tinkl
qml/Stage/MoveHandler.qml−5
@@ -184,10 +184,5 @@ QtObject {
184 priv.progress = 0;
184 priv.progress = 0;
185 priv.resetEdges();
185 priv.resetEdges();
186 }
186 }
187− if ((target.state == "normal" || target.state == "restored") && priv.progress == 0) {
188− // save the x/y to restore to
189− target.restoredX = target.x;
190− target.restoredY = target.y;
191− }
192 }
187 }
193}
188}
qml/Stage/Stage.qml+10−2
@@ -752,6 +752,14 @@ FocusScope {
752 normalHeight = appDelegate.height;
752 normalHeight = appDelegate.height;
753 }
753 }
754 }
754 }
755+ function updateRestoredGeometry() {
756+ if (appDelegate.state == "normal" || appDelegate.state == "restored") {
757+ // save the x/y to restore to
758+ restoredX = appDelegate.x;
759+ restoredY = appDelegate.y;
760+ }
761+ }
762+
755 Connections {
763 Connections {
756 target: appDelegate
764 target: appDelegate
757 onXChanged: appDelegate.updateNormalGeometry();
765 onXChanged: appDelegate.updateNormalGeometry();
@@ -1612,7 +1620,7 @@ FocusScope {
1612 }
1620 }
1613 onMinimizeClicked: { appDelegate.requestMinimize(); }
1621 onMinimizeClicked: { appDelegate.requestMinimize(); }
1614 onDecorationPressed: { appDelegate.activate(); }
1622 onDecorationPressed: { appDelegate.activate(); }
1615− onDecorationReleased: fakeRectangle.commit();
1623+ onDecorationReleased: fakeRectangle.visible ? fakeRectangle.commit() : appDelegate.updateRestoredGeometry()
1616
1624
1617 property real angle: 0
1625 property real angle: 0
1618 Behavior on angle { enabled: priv.closingIndex >= 0; UbuntuNumberAnimation {} }
1626 Behavior on angle { enabled: priv.closingIndex >= 0; UbuntuNumberAnimation {} }
@@ -1656,7 +1664,7 @@ FocusScope {
1656 onFakeMaximizeBottomLeftAnimationRequested: if (!appDelegate.maximizedBottomLeft) fakeRectangle.maximizeBottomLeft(amount, true);
1664 onFakeMaximizeBottomLeftAnimationRequested: if (!appDelegate.maximizedBottomLeft) fakeRectangle.maximizeBottomLeft(amount, true);
1657 onFakeMaximizeBottomRightAnimationRequested: if (!appDelegate.maximizedBottomRight) fakeRectangle.maximizeBottomRight(amount, true);
1665 onFakeMaximizeBottomRightAnimationRequested: if (!appDelegate.maximizedBottomRight) fakeRectangle.maximizeBottomRight(amount, true);
1658 onStopFakeAnimation: fakeRectangle.stop();
1666 onStopFakeAnimation: fakeRectangle.stop();
1659− onDragReleased: fakeRectangle.commit();
1667+ onDragReleased: fakeRectangle.visible ? fakeRectangle.commit() : appDelegate.updateRestoredGeometry()
1660 }
1668 }
1661
1669
1662 WindowedFullscreenPolicy {
1670 WindowedFullscreenPolicy {