@@ -33,7 +33,8 @@ Item {
33 // FIXME: Once we have Qt DPR support, this should be Qt.styleHints.startDragDistance
33 // FIXME: Once we have Qt DPR support, this should be Qt.styleHints.startDragDistance
34 readonly property int clickThreshold: units.gu(1.5)
34 readonly property int clickThreshold: units.gu(1.5)
35 property bool isClick: false
35 property bool isClick: false
36− property bool pressed: false
36+ property bool isDoubleClick: false
37+ property bool isDrag: false
38 onPressed: {
39 onPressed: {
39 // If double-tapping *really* fast, it could happen that we end up having only point2 pressed
40 // If double-tapping *really* fast, it could happen that we end up having only point2 pressed
@@ -42,7 +43,7 @@ Item {
42 && clickTimer.running) {
43 && clickTimer.running) {
43 clickTimer.stop();
44 clickTimer.stop();
44 uinput.pressMouse(UInput.ButtonLeft)
45 uinput.pressMouse(UInput.ButtonLeft)
45− pressed = true;
46+ isDoubleClick = true;
47 isClick = true;
48 isClick = true;
@@ -59,14 +60,15 @@ Item {
61 onReleased: {
62 onReleased: {
63+ if (isDoubleClick || isDrag) {
64+ uinput.releaseMouse(UInput.ButtonLeft)
65+ isDoubleClick = false;
62 if (isClick) {
67 if (isClick) {
64− uinput.releaseMouse(UInput.ButtonLeft)
67 clickTimer.scheduleClick(point1.pressed ? UInput.ButtonRight : UInput.ButtonLeft)
68 clickTimer.scheduleClick(point1.pressed ? UInput.ButtonRight : UInput.ButtonLeft)
69 isClick = false;
70 isClick = false;
@@ -90,6 +92,7 @@ Item {
90 (Math.abs(tp.x - tp.startX) > clickThreshold ||
92 (Math.abs(tp.x - tp.startX) > clickThreshold ||
91 Math.abs(tp.y - tp.startY) > clickThreshold)) {
93 Math.abs(tp.y - tp.startY) > clickThreshold)) {
92 isClick = false;
94 isClick = false;
95 uinput.moveMouse(tp.x - tp.previousX, tp.y - tp.previousY);
98 uinput.moveMouse(tp.x - tp.previousX, tp.y - tp.previousY);