on xenial help sign in
cancel the drag as soon as we're entering the spread
2db3408Lukáš Tinkl
qml/Stage/DecoratedWindow.qml+4
@@ -80,6 +80,10 @@ FocusScope {
80 signal decorationPressed()
80 signal decorationPressed()
81 signal decorationReleased()
81 signal decorationReleased()
82
82
83+ function cancelDrag() {
84+ moveHandler.cancelDrag();
85+ }
86+
83 QtObject {
87 QtObject {
84 id: d
88 id: d
85 property int requestedDecorationHeight: root.hasDecoration ? decoration.height : 0
89 property int requestedDecorationHeight: root.hasDecoration ? decoration.height : 0
qml/Stage/MoveHandler.qml+9
@@ -190,4 +190,13 @@ QtObject {
190 target.restoredY = target.y;
190 target.restoredY = target.y;
191 }
191 }
192 }
192 }
193+
194+ function cancelDrag() {
195+ priv.dragging = false;
196+ root.stopFakeAnimation();
197+ priv.mouseDownTimer.stop();
198+ Mir.cursorName = "";
199+ priv.progress = 0;
200+ priv.resetEdges();
201+ }
193}
202}
qml/Stage/Stage.qml+2
@@ -1173,6 +1173,7 @@ FocusScope {
1173 states: [
1173 states: [
1174 State {
1174 State {
1175 name: "spread"; when: root.state == "spread"
1175 name: "spread"; when: root.state == "spread"
1176+ StateChangeScript { script: { decoratedWindow.cancelDrag(); } }
1176 PropertyChanges {
1177 PropertyChanges {
1177 target: decoratedWindow;
1178 target: decoratedWindow;
1178 showDecoration: false;
1179 showDecoration: false;
@@ -1199,6 +1200,7 @@ FocusScope {
1199 }
1200 }
1200 PropertyChanges { target: dragArea; enabled: true }
1201 PropertyChanges { target: dragArea; enabled: true }
1201 PropertyChanges { target: windowInfoItem; opacity: spreadMaths.tileInfoOpacity; visible: spreadMaths.itemVisible }
1202 PropertyChanges { target: windowInfoItem; opacity: spreadMaths.tileInfoOpacity; visible: spreadMaths.itemVisible }
1203+ PropertyChanges { target: touchControls; enabled: false }
1202 },
1204 },
1203 State {
1205 State {
1204 name: "stagedRightEdge"
1206 name: "stagedRightEdge"