diff --git a/libweston/compositor-wayland.c b/libweston/compositor-wayland.c index 5ed90c0f..e80ecc16 100644 --- a/libweston/compositor-wayland.c +++ b/libweston/compositor-wayland.c @@ -2146,7 +2146,7 @@ input_handle_touch_down(void *data, struct wl_touch *wl_touch, weston_output_transform_coordinate(&output->base, x, y, &x, &y); - notify_touch(&input->base, &ts, id, x, y, WL_TOUCH_DOWN); + notify_touch(input->touch_device, &ts, id, x, y, WL_TOUCH_DOWN); input->touch_active = true; } @@ -2187,7 +2187,7 @@ input_handle_touch_up(void *data, struct wl_touch *wl_touch, } if (active) - notify_touch(&input->base, &ts, id, 0, 0, WL_TOUCH_UP); + notify_touch(input->touch_device, &ts, id, 0, 0, WL_TOUCH_UP); } static void @@ -2216,7 +2216,7 @@ input_handle_touch_motion(void *data, struct wl_touch *wl_touch, weston_output_transform_coordinate(&output->base, x, y, &x, &y); - notify_touch(&input->base, &ts, id, x, y, WL_TOUCH_MOTION); + notify_touch(input->touch_device, &ts, id, x, y, WL_TOUCH_MOTION); } static void @@ -2227,7 +2227,7 @@ input_handle_touch_frame(void *data, struct wl_touch *wl_touch) if (!input->touch_focus || !input->touch_active) return; - notify_touch_frame(&input->base); + notify_touch_frame(input->touch_device); } static void @@ -2238,7 +2238,7 @@ input_handle_touch_cancel(void *data, struct wl_touch *wl_touch) if (!input->touch_focus || !input->touch_active) return; - notify_touch_cancel(&input->base); + notify_touch_cancel(input->touch_device); } static const struct wl_touch_listener touch_listener = { diff --git a/libweston/compositor.h b/libweston/compositor.h index 7f3fdb95..09a9dab8 100644 --- a/libweston/compositor.h +++ b/libweston/compositor.h @@ -1543,13 +1543,13 @@ void notify_keyboard_focus_out(struct weston_seat *seat); void -notify_touch(struct weston_seat *seat, const struct timespec *time, +notify_touch(struct weston_touch_device *device, const struct timespec *time, int touch_id, double x, double y, int touch_type); void -notify_touch_frame(struct weston_seat *seat); +notify_touch_frame(struct weston_touch_device *device); void -notify_touch_cancel(struct weston_seat *seat); +notify_touch_cancel(struct weston_touch_device *device); void weston_layer_entry_insert(struct weston_layer_entry *list, diff --git a/libweston/input.c b/libweston/input.c index acb564e0..e02b3060 100644 --- a/libweston/input.c +++ b/libweston/input.c @@ -2347,12 +2347,12 @@ weston_touch_set_focus(struct weston_touch *touch, struct weston_view *view) * */ WL_EXPORT void -notify_touch(struct weston_seat *seat, const struct timespec *time, +notify_touch(struct weston_touch_device *device, const struct timespec *time, int touch_id, double double_x, double double_y, int touch_type) { - struct weston_compositor *ec = seat->compositor; - struct weston_touch *touch = weston_seat_get_touch(seat); - struct weston_touch_grab *grab = touch->grab; + struct weston_touch *touch = device->aggregate; + struct weston_touch_grab *grab = device->aggregate->grab; + struct weston_compositor *ec = device->aggregate->seat->compositor; struct weston_view *ev; wl_fixed_t sx, sy; wl_fixed_t x = wl_fixed_from_double(double_x); @@ -2426,19 +2426,17 @@ notify_touch(struct weston_seat *seat, const struct timespec *time, } WL_EXPORT void -notify_touch_frame(struct weston_seat *seat) +notify_touch_frame(struct weston_touch_device *device) { - struct weston_touch *touch = weston_seat_get_touch(seat); - struct weston_touch_grab *grab = touch->grab; + struct weston_touch_grab *grab = device->aggregate->grab; grab->interface->frame(grab); } WL_EXPORT void -notify_touch_cancel(struct weston_seat *seat) +notify_touch_cancel(struct weston_touch_device *device) { - struct weston_touch *touch = weston_seat_get_touch(seat); - struct weston_touch_grab *grab = touch->grab; + struct weston_touch_grab *grab = device->aggregate->grab; grab->interface->cancel(grab); } diff --git a/libweston/libinput-device.c b/libweston/libinput-device.c index 1fc01335..dda28fdc 100644 --- a/libweston/libinput-device.c +++ b/libweston/libinput-device.c @@ -438,7 +438,7 @@ handle_touch_with_coords(struct libinput_device *libinput_device, weston_output_transform_coordinate(device->output, x, y, &x, &y); - notify_touch(device->seat, &time, slot, x, y, touch_type); + notify_touch(device->touch_device, &time, slot, x, y, touch_type); } static void @@ -467,7 +467,7 @@ handle_touch_up(struct libinput_device *libinput_device, timespec_from_usec(&time, libinput_event_touch_get_time_usec(touch_event)); - notify_touch(device->seat, &time, slot, 0, 0, WL_TOUCH_UP); + notify_touch(device->touch_device, &time, slot, 0, 0, WL_TOUCH_UP); } static void @@ -476,9 +476,8 @@ handle_touch_frame(struct libinput_device *libinput_device, { struct evdev_device *device = libinput_device_get_user_data(libinput_device); - struct weston_seat *seat = device->seat; - notify_touch_frame(seat); + notify_touch_frame(device->touch_device); } int diff --git a/tests/weston-test.c b/tests/weston-test.c index 9662b67c..412eb243 100644 --- a/tests/weston-test.c +++ b/tests/weston-test.c @@ -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); }