case QEvent::TouchUpdate:
case QEvent::TouchEnd:
{
- QSet<WaylandSurface *> targets;
+ WaylandSurface *targetSurface = 0;
QTouchEvent *te = static_cast<QTouchEvent *>(event);
QList<QTouchEvent::TouchPoint> points = te->touchPoints();
- for (int i = 0; i < points.count(); ++i) {
- const QTouchEvent::TouchPoint &tp(points.at(i));
- WaylandSurface *targetSurface = surfaceAt(tp.pos().toPoint());
- if (targetSurface)
- targets.insert(targetSurface);
+ QPoint pointPos;
+ if (!points.isEmpty()) {
+ pointPos = points.at(0).pos().toPoint();
+ targetSurface = surfaceAt(pointPos);
}
- foreach (WaylandSurface *surface, targets)
+ if (targetSurface && targetSurface != input->mouseFocus())
+ input->setMouseFocus(targetSurface, pointPos, pointPos);
+ if (input->mouseFocus())
input->sendFullTouchEvent(te);
break;
}
struct wl_resource *resource = base()->pointer_focus_resource;
switch (state) {
case Qt::TouchPointPressed:
- wl_resource_post_event(resource, WL_INPUT_DEVICE_TOUCH_DOWN, time, this, id, x, y);
+ wl_resource_post_event(resource, WL_INPUT_DEVICE_TOUCH_DOWN, time, base()->pointer_focus, id, x, y);
break;
case Qt::TouchPointMoved:
wl_resource_post_event(resource, WL_INPUT_DEVICE_TOUCH_MOTION, time, id, x, y);