@@ -84,36 +84,27 @@ Item {
8484 }
8585 }
8686
87− // Event eater
88−// MouseArea {
89−// anchors.fill: parent
90−// onClicked: root.clicked()
91−// onWheel: wheel.accepted = true
92−// }
93−
9487 MultiPointTouchArea {
9588 anchors.fill: parent
96−// mouseEnabled: false
9789 maximumTouchPoints: 1
9890 property int offset: 0
9991
92+ // tp.startY seems to be broken for mouse interaction... lets track it ourselves
93+ property int startY: 0
94+
10095 touchPoints: [
10196 TouchPoint {
10297 id: tp
10398 }
10499 ]
105100
106− onCanceled: {
107− print("****************** cancelled")
108− fakeDragItem.Drag.active = false;
109− fakeDragItem.surface = null;
110− d.moving = false
111− animation.animate("center");
101+ onPressed: {
102+ startY = tp.y
112103 }
113104
114105 onTouchUpdated: {
115106 if (!d.moving || !tp.pressed) {
116− if (Math.abs(tp.startY - tp.y) > d.threshold) {
107+ if (Math.abs(startY - tp.y) > d.threshold) {
117108 d.moving = true;
118109 d.dragEvents = []
119110 offset = tp.y - tp.startY;
@@ -126,10 +117,10 @@ Item {
126117 var value = tp.y - tp.startY - offset;
127118 if (value < 0) {
128119 var coords = mapToItem(shell, tp.x, tp.y);
129− fakeDragItem.x = coords.x - units.gu(5)
130− fakeDragItem.y = coords.y - units.gu(5)
131− fakeDragItem.Drag.hotSpot.x = units.gu(5)
132− fakeDragItem.Drag.hotSpot.y = units.gu(5)
120+ fakeDragItem.Drag.hotSpot.x = fakeDragItem.width / 2
121+ fakeDragItem.Drag.hotSpot.y = units.gu(2)
122+ fakeDragItem.x = coords.x - fakeDragItem.Drag.hotSpot.x
123+ fakeDragItem.y = coords.y - fakeDragItem.Drag.hotSpot.y
133124 fakeDragItem.Drag.active = true;
134125 fakeDragItem.surface = model.window.surface;
135126
@@ -145,7 +136,6 @@ Item {
145136 }
146137
147138 onReleased: {
148− print("released!")
149139 var result = fakeDragItem.Drag.drop();
150140 fakeDragItem.surface = null;
151141
@@ -168,6 +158,13 @@ Item {
168158 animation.animate("center")
169159 }
170160 }
161+
162+ onCanceled: {
163+ fakeDragItem.Drag.active = false;
164+ fakeDragItem.surface = null;
165+ d.moving = false
166+ animation.animate("center");
167+ }
171168 }
172169
173170 UbuntuNumberAnimation {