on xenial help sign in
don't accept drags with button != left; fix the tests
a323c57Lukáš Tinkl
qml/Stages/WindowDecoration.qml+4−1
@@ -23,7 +23,6 @@ import "../Components/PanelState"
23MouseArea {
23MouseArea {
24 id: root
24 id: root
25 clip: true
25 clip: true
26− acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
27
26
28 property Item target
27 property Item target
29 property alias title: titleLabel.text
28 property alias title: titleLabel.text
@@ -45,6 +44,10 @@ MouseArea {
45 }
44 }
46
45
47 onPressedChanged: {
46 onPressedChanged: {
47+ if (pressedButtons != Qt.LeftButton) {
48+ return;
49+ }
50+
48 if (pressed) {
51 if (pressed) {
49 var pos = mapToItem(root.target, mouseX, mouseY);
52 var pos = mapToItem(root.target, mouseX, mouseY);
50 priv.distanceX = pos.x;
53 priv.distanceX = pos.x;
tests/qmltests/Stages/tst_DesktopStage.qml+3−3
@@ -672,9 +672,9 @@ Item {
672
672
673 function test_eatWindowDecorationMouseEvents_data() {
673 function test_eatWindowDecorationMouseEvents_data() {
674 return [
674 return [
675− {tag: "left mouse press", signalName: "clicked", button: Qt.LeftButton },
675+ {tag: "left mouse press", signalName: "pressed", button: Qt.LeftButton },
676− {tag: "right mouse press", signalName: "clicked", button: Qt.RightButton },
676+ {tag: "right mouse press", signalName: "pressed", button: Qt.RightButton },
677− {tag: "middle mouse press", signalName: "clicked", button: Qt.MiddleButton },
677+ {tag: "middle mouse press", signalName: "pressed", button: Qt.MiddleButton },
678 {tag: "mouse wheel", signalName: "wheel", button: Qt.MiddleButton }
678 {tag: "mouse wheel", signalName: "wheel", button: Qt.MiddleButton }
679 ]
679 ]
680 }
680 }