diff options
author | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2012-01-10 10:33:55 +0200 |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2012-01-10 12:36:44 +0100 |
commit | becc850c22c3bc9e4a2a2fc7140cb0dc95bfd8df (patch) | |
tree | 16854b4b43c1725864db162339554556f7f84d58 /examples | |
parent | 6c32ea510f7f75764c7039e6f117e9b6e43b4622 (diff) | |
download | qtwayland-becc850c22c3bc9e4a2a2fc7140cb0dc95bfd8df.tar.gz |
Add a function to the compositor api to send full touch events
A simple sendTouchPointEvent(id, x, y, ...) type of function will not
be sufficient in the future due to the amount of data in a touch
event; therefore an additional sendFullTouchEvent is introduced. This
function takes a QTouchEvent and posts a series of down, motion, up,
frame events as needed. In the future it may be changed so that it
maps to a protocol extension instead of the standard events.
As an example qwindow-compositor is updated to use this new function.
Change-Id: I39d3df1c6d4868364440f59789d01fc5b7b80dac
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/qwindow-compositor/qwindowcompositor.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/examples/qwindow-compositor/qwindowcompositor.cpp b/examples/qwindow-compositor/qwindowcompositor.cpp index fd5b24ae..14d43c4d 100644 --- a/examples/qwindow-compositor/qwindowcompositor.cpp +++ b/examples/qwindow-compositor/qwindowcompositor.cpp @@ -258,15 +258,12 @@ bool QWindowCompositor::eventFilter(QObject *obj, QEvent *event) QList<QTouchEvent::TouchPoint> points = te->touchPoints(); for (int i = 0; i < points.count(); ++i) { const QTouchEvent::TouchPoint &tp(points.at(i)); - QPoint local; - WaylandSurface *targetSurface = surfaceAt(tp.pos().toPoint(), &local); - if (targetSurface) { - targetSurface->sendTouchPointEvent(tp.id(), local.x(), local.y(), tp.state()); + WaylandSurface *targetSurface = surfaceAt(tp.pos().toPoint()); + if (targetSurface) targets.insert(targetSurface); - } } foreach (WaylandSurface *surface, targets) - surface->sendTouchFrameEvent(); + surface->sendFullTouchEvent(te); break; } default: |