on xenial help sign in
don't accept drags with button != left; fix the tests
commita323c57700017c16bf4fa71def2bfebac10ae911 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateThu 9 Jun 2016, 14:03 (10 years ago) parentd311bc0
2 files changed+7−4
qml/Stages/WindowDecoration.qml+4−1 tests/qmltests/Stages/tst_DesktopStage.qml+3−3
qml/Stages/WindowDecoration.qml+4−1
@@ -23,7 +23,6 @@ import "../Components/PanelState"
2323MouseArea {
2424 id: root
2525 clip: true
26− acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
2726
2827 property Item target
2928 property alias title: titleLabel.text
@@ -45,6 +44,10 @@ MouseArea {
4544 }
4645
4746 onPressedChanged: {
47+ if (pressedButtons != Qt.LeftButton) {
48+ return;
49+ }
50+
4851 if (pressed) {
4952 var pos = mapToItem(root.target, mouseX, mouseY);
5053 priv.distanceX = pos.x;
tests/qmltests/Stages/tst_DesktopStage.qml+3−3
@@ -672,9 +672,9 @@ Item {
672672
673673 function test_eatWindowDecorationMouseEvents_data() {
674674 return [
675− {tag: "left mouse press", signalName: "clicked", button: Qt.LeftButton },
676− {tag: "right mouse press", signalName: "clicked", button: Qt.RightButton },
677− {tag: "middle mouse press", signalName: "clicked", button: Qt.MiddleButton },
675+ {tag: "left mouse press", signalName: "pressed", button: Qt.LeftButton },
676+ {tag: "right mouse press", signalName: "pressed", button: Qt.RightButton },
677+ {tag: "middle mouse press", signalName: "pressed", button: Qt.MiddleButton },
678678 {tag: "mouse wheel", signalName: "wheel", button: Qt.MiddleButton }
679679 ]
680680 }