on xenial help sign in
address review comments
commit54c22460ec5c16c637f4aa3749ff5e19cd1decbb authorLukáš Tinkl <lukas.tinkl@canonical.com> dateWed 8 Mar 2017, 00:59 (10 years ago) parent16aeee9
2 files changed+10−7
qml/Stage/MoveHandler.qml−5 qml/Stage/Stage.qml+10−2
qml/Stage/MoveHandler.qml−5
@@ -184,10 +184,5 @@ QtObject {
184184 priv.progress = 0;
185185 priv.resetEdges();
186186 }
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− }
192187 }
193188}
qml/Stage/Stage.qml+10−2
@@ -752,6 +752,14 @@ FocusScope {
752752 normalHeight = appDelegate.height;
753753 }
754754 }
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+
755763 Connections {
756764 target: appDelegate
757765 onXChanged: appDelegate.updateNormalGeometry();
@@ -1612,7 +1620,7 @@ FocusScope {
16121620 }
16131621 onMinimizeClicked: { appDelegate.requestMinimize(); }
16141622 onDecorationPressed: { appDelegate.activate(); }
1615− onDecorationReleased: fakeRectangle.commit();
1623+ onDecorationReleased: fakeRectangle.visible ? fakeRectangle.commit() : appDelegate.updateRestoredGeometry()
16161624
16171625 property real angle: 0
16181626 Behavior on angle { enabled: priv.closingIndex >= 0; UbuntuNumberAnimation {} }
@@ -1656,7 +1664,7 @@ FocusScope {
16561664 onFakeMaximizeBottomLeftAnimationRequested: if (!appDelegate.maximizedBottomLeft) fakeRectangle.maximizeBottomLeft(amount, true);
16571665 onFakeMaximizeBottomRightAnimationRequested: if (!appDelegate.maximizedBottomRight) fakeRectangle.maximizeBottomRight(amount, true);
16581666 onStopFakeAnimation: fakeRectangle.stop();
1659− onDragReleased: fakeRectangle.commit();
1667+ onDragReleased: fakeRectangle.visible ? fakeRectangle.commit() : appDelegate.updateRestoredGeometry()
16601668 }
16611669
16621670 WindowedFullscreenPolicy {