diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2019-08-23 11:42:46 +0200 |
---|---|---|
committer | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2019-09-17 09:51:45 +0200 |
commit | 694c96254b79cbe1c45ee6bafedf9649ee88abbc (patch) | |
tree | 0392ad04c956ad01147f00971c2f07621f19254b /tests/auto/client/shared/coreprotocol.cpp | |
parent | 7da254456001193f93100070e229fc6cffc92495 (diff) |
Add client test for multi touch motion
Make sure touchPoint order doesn't change even though the compositor
event order does.
Task-number: QTBUG-77014
Change-Id: If6b8a930344836ca52cc12fe7f29c8ac863d81ba
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'tests/auto/client/shared/coreprotocol.cpp')
-rw-r--r-- | tests/auto/client/shared/coreprotocol.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/client/shared/coreprotocol.cpp b/tests/auto/client/shared/coreprotocol.cpp index 120c256c6..b0be2cb4e 100644 --- a/tests/auto/client/shared/coreprotocol.cpp +++ b/tests/auto/client/shared/coreprotocol.cpp @@ -424,6 +424,18 @@ uint Touch::sendUp(wl_client *client, int id) return serial; } +void Touch::sendMotion(wl_client *client, const QPointF &position, int id) +{ + wl_fixed_t x = wl_fixed_from_double(position.x()); + wl_fixed_t y = wl_fixed_from_double(position.y()); + + auto time = m_seat->m_compositor->currentTimeMilliseconds(); + + const auto touchResources = resourceMap().values(client); + for (auto *r : touchResources) + wl_touch::send_motion(r->handle, time, id, x, y); +} + void Touch::sendFrame(wl_client *client) { const auto touchResources = resourceMap().values(client); |