From a25c186126fe37a0e5e12e2d12865ed27eb1f4e8 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Fri, 22 Dec 2017 11:26:41 +0100 Subject: 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 --- tests/auto/client/client/mockinput.cpp | 8 ++++++-- 1 file 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) -- cgit v1.2.3