@@ -84,36 +84,27 @@ Item {
89−// anchors.fill: parent
90−// onClicked: root.clicked()
91−// onWheel: wheel.accepted = true
94 MultiPointTouchArea {
87 MultiPointTouchArea {
95 anchors.fill: parent
88 anchors.fill: parent
96−// mouseEnabled: false
97 maximumTouchPoints: 1
89 maximumTouchPoints: 1
98 property int offset: 0
90 property int offset: 0
92+ // tp.startY seems to be broken for mouse interaction... lets track it ourselves
93+ property int startY: 0
100 touchPoints: [
95 touchPoints: [
101 TouchPoint {
96 TouchPoint {
106− onCanceled: {
101+ onPressed: {
107− print("****************** cancelled")
102+ startY = tp.y
108− fakeDragItem.Drag.active = false;
109− fakeDragItem.surface = null;
111− animation.animate("center");
114 onTouchUpdated: {
105 onTouchUpdated: {
115 if (!d.moving || !tp.pressed) {
106 if (!d.moving || !tp.pressed) {
116− if (Math.abs(tp.startY - tp.y) > d.threshold) {
107+ if (Math.abs(startY - tp.y) > d.threshold) {
117 d.moving = true;
108 d.moving = true;
118 d.dragEvents = []
109 d.dragEvents = []
119 offset = tp.y - tp.startY;
110 offset = tp.y - tp.startY;
@@ -126,10 +117,10 @@ Item {
126 var value = tp.y - tp.startY - offset;
117 var value = tp.y - tp.startY - offset;
127 if (value < 0) {
118 if (value < 0) {
128 var coords = mapToItem(shell, tp.x, tp.y);
119 var coords = mapToItem(shell, tp.x, tp.y);
129− fakeDragItem.x = coords.x - units.gu(5)
120+ fakeDragItem.Drag.hotSpot.x = fakeDragItem.width / 2
130− fakeDragItem.y = coords.y - units.gu(5)
121+ fakeDragItem.Drag.hotSpot.y = units.gu(2)
131− fakeDragItem.Drag.hotSpot.x = units.gu(5)
122+ fakeDragItem.x = coords.x - fakeDragItem.Drag.hotSpot.x
132− fakeDragItem.Drag.hotSpot.y = units.gu(5)
123+ fakeDragItem.y = coords.y - fakeDragItem.Drag.hotSpot.y
133 fakeDragItem.Drag.active = true;
124 fakeDragItem.Drag.active = true;
134 fakeDragItem.surface = model.window.surface;
125 fakeDragItem.surface = model.window.surface;
@@ -145,7 +136,6 @@ Item {
147 onReleased: {
138 onReleased: {
149 var result = fakeDragItem.Drag.drop();
139 var result = fakeDragItem.Drag.drop();
150 fakeDragItem.surface = null;
140 fakeDragItem.surface = null;
@@ -168,6 +158,13 @@ Item {
168 animation.animate("center")
158 animation.animate("center")
163+ fakeDragItem.Drag.active = false;
164+ fakeDragItem.surface = null;
166+ animation.animate("center");
173 UbuntuNumberAnimation {
170 UbuntuNumberAnimation {