@@ -24,6 +24,7 @@ Item {
2424 Component.onDestruction: removeMouse();
2525 }
2626
27+ readonly property bool pressed: point1.pressed || point2.pressed
2728
2829 MultiPointTouchArea {
2930 objectName: "touchPadArea"
@@ -32,7 +33,8 @@ Item {
3233 // FIXME: Once we have Qt DPR support, this should be Qt.styleHints.startDragDistance
3334 readonly property int clickThreshold: units.gu(1.5)
3435 property bool isClick: false
35− property bool pressed: false
36+ property bool isDoubleClick: false
37+ property bool isDrag: false
3638
3739 onPressed: {
3840 // If double-tapping *really* fast, it could happen that we end up having only point2 pressed
@@ -41,7 +43,7 @@ Item {
4143 && clickTimer.running) {
4244 clickTimer.stop();
4345 uinput.pressMouse(UInput.ButtonLeft)
44− pressed = true;
46+ isDoubleClick = true;
4547 }
4648 isClick = true;
4749 }
@@ -58,14 +60,15 @@ Item {
5860 }
5961
6062 onReleased: {
63+ if (isDoubleClick || isDrag) {
64+ uinput.releaseMouse(UInput.ButtonLeft)
65+ isDoubleClick = false;
66+ }
6167 if (isClick) {
62− if (pressed) {
63− uinput.releaseMouse(UInput.ButtonLeft)
64− pressed = false;
65− }
6668 clickTimer.scheduleClick(point1.pressed ? UInput.ButtonRight : UInput.ButtonLeft)
6769 }
6870 isClick = false;
71+ isDrag = false;
6972 }
7073
7174 Timer {
@@ -89,6 +92,7 @@ Item {
8992 (Math.abs(tp.x - tp.startX) > clickThreshold ||
9093 Math.abs(tp.y - tp.startY) > clickThreshold)) {
9194 isClick = false;
95+ isDrag = true;
9296 }
9397
9498 uinput.moveMouse(tp.x - tp.previousX, tp.y - tp.previousY);