libweston: notify_touch API to use weston_touch_device

Relay touch input events into libweston core through the
weston_touch_device, so that the core can tell which individual physical
device they come from.

This is necessary for supporting touchscreen calibration, where one
needs to process a single physical device at a time instead of the
aggregate of all touch devices on the weston_seat.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
v1 Tested-by: Matt Hoosier <matt.hoosier@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Pekka Paalanen
2018-02-26 14:43:00 +02:00
parent 09fbe14e8f
commit bcbce33000
5 changed files with 23 additions and 24 deletions
+4 -2
View File
@@ -595,12 +595,14 @@ send_touch(struct wl_client *client, struct wl_resource *resource,
int32_t touch_id, wl_fixed_t x, wl_fixed_t y, uint32_t touch_type)
{
struct weston_test *test = wl_resource_get_user_data(resource);
struct weston_seat *seat = get_seat(test);
struct weston_touch_device *device = test->touch_device[0];
struct timespec time;
assert(device);
timespec_from_proto(&time, tv_sec_hi, tv_sec_lo, tv_nsec);
notify_touch(seat, &time, touch_id, wl_fixed_to_double(x),
notify_touch(device, &time, touch_id, wl_fixed_to_double(x),
wl_fixed_to_double(y), touch_type);
}