summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2017-12-22 11:26:41 +0100
committerJohan Helsing <johan.helsing@qt.io>2018-01-04 12:07:01 +0000
commita25c186126fe37a0e5e12e2d12865ed27eb1f4e8 (patch)
tree70e5c28ff3736842f133588d236297695c24a633
parent154bdf45dd51a521058c820e7b871008ce8508ae (diff)
Client tests: Fix wrong position being sent when mocking touch events
We were sending ints when we should have been sending wl_fixed_ts. Change-Id: I9f074334cb3ea8a3d61789ff641c2d022a5989b7 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
-rw-r--r--tests/auto/client/client/mockinput.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/auto/client/client/mockinput.cpp b/tests/auto/client/client/mockinput.cpp
index 99acdd43a..b2bcdf2e6 100644
--- a/tests/auto/client/client/mockinput.cpp
+++ b/tests/auto/client/client/mockinput.cpp
@@ -365,7 +365,9 @@ void Touch::sendDown(Surface *surface, const QPoint &position, int id)
Q_ASSERT(surface);
Resource *resource = resourceMap().value(surface->resource()->client());
Q_ASSERT(resource);
- wl_touch_send_down(resource->handle, serial, time, surface->resource()->handle, id, position.x(), position.y());
+ auto x = wl_fixed_from_int(position.x());
+ auto y = wl_fixed_from_int(position.y());
+ wl_touch_send_down(resource->handle, serial, time, surface->resource()->handle, id, x, y);
}
void Touch::sendUp(Surface *surface, int id)
@@ -378,7 +380,9 @@ void Touch::sendMotion(Surface *surface, const QPoint &position, int id)
{
Resource *resource = resourceMap().value(surface->resource()->client());
uint32_t time = m_compositor->time();
- wl_touch_send_motion(resource->handle, time, id, position.x(), position.y());
+ auto x = wl_fixed_from_int(position.x());
+ auto y = wl_fixed_from_int(position.y());
+ wl_touch_send_motion(resource->handle, time, id, x, y);
}
void Touch::sendFrame(Surface *surface)