libweston: Make weston_touch destruction safe
authorAlexandros Frantzis <alexandros.frantzis@collabora.com>
Fri, 26 Jan 2018 16:47:57 +0000 (18:47 +0200)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Thu, 1 Feb 2018 10:53:13 +0000 (12:53 +0200)
commitb0b598c73c621206fd6e306fc976bad40e94fd12
tree4a1680d9b43b5891f1d270d17d0a769edd13232f
parent7a314d63283b9a8ffcc02d9a465d6f6467b861b2
libweston: Make weston_touch destruction safe

Ensure the server can safely handle client requests for wl_touch
resources that have become inert due to a weston_touch object
destruction.

This change involves, among other things, setting the weston_touch
object, instead of the weston_seat object, as the user data for wl_touch
resources. Although this is not strictly required at the moment (since
no code is using the wl_touch user data), it makes the code safer:

 * It makes more sense conceptually.
 * It is consistent with how wl_pointer resources are handled.
 * It allows us to clear the user data during weston_touch
   destruction, so other code can check whether the resource is
   inert.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
libweston/input.c