On Wed, 20 Dec 2017 16:18:01 +0200 Alexandros Frantzis <[email protected]> wrote:
> Implement the zwp_input_timestamps_v1.get_touch_timestamps request to > subscribe to timestamp events for wl_touch resources. > > Signed-off-by: Alexandros Frantzis <[email protected]> > --- > libweston/compositor.h | 2 ++ > libweston/input.c | 53 > +++++++++++++++++++++++++++++++++++++++++++------- > tests/touch-test.c | 46 +++++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 94 insertions(+), 7 deletions(-) > @@ -4643,7 +4665,24 @@ input_timestamps_manager_get_touch_timestamps(struct > wl_client *client, > uint32_t id, > struct wl_resource > *touch_resource) > { > - wl_client_post_no_memory(client); > + struct weston_seat *seat = wl_resource_get_user_data(touch_resource); > + struct wl_resource *input_ts; > + > + input_ts = wl_resource_create(client, > + &zwp_input_timestamps_v1_interface, > + 1, id); > + if (!input_ts) { > + wl_client_post_no_memory(client); > + return; > + } > + > + wl_resource_set_implementation(input_ts, > + &input_timestamps_interface, > + touch_resource, > + unbind_resource); > + > + wl_list_insert(&seat->touch_state->timestamps_list, > + wl_resource_get_link(input_ts)); Btw. each of the three patches adds a new list to weston_keyboard, weston_pointer, weston_touch, but following the example already set in the code, do not handle that struct getting destroyed while client resources for it still exist. This would be good to fix, at least for the new lists introduced in these patches. I only realized that after sending the earlier R-bs. You can find the places with: $ git grep -p 'XXX: What about' Otherwise the patch looks good, tests included. Nice work with the series. Thanks, pq
pgp7L9bai6NBn.pgp
Description: OpenPGP digital signature
_______________________________________________ wayland-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/wayland-devel
