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>
This commit is contained in:
Johan Klokkhammer Helsing 2017-12-22 11:26:41 +01:00 committed by Johan Helsing
parent 7f8d9b7f54
commit d7f4f6ba10

View File

@ -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)