tests: check for NULL surface in keyboard and pointer handlers
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>
Thu, 21 Apr 2016 13:47:20 +0000 (16:47 +0300)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Fri, 22 Apr 2016 07:45:09 +0000 (10:45 +0300)
commitfd01ba055d118eaf9b51aac2f93b9a9b697e31a8
treec6ecf1c50021cc9a339053ca95117b0832e5ead1
parent13a26e02e5efe176cd8262ccd8203e4225f22613
tests: check for NULL surface in keyboard and pointer handlers

When a test destroys a wl_surface, it is still possible to get events
referring to the destroyed surface. The surface in such cases will be
NULL.

Handle NULL surface gracefully in keyboard and pointer enter/leave
handlers. Touch-down handler is already NULL-safe.

This fixes a SEGV in a test I am writing for wp_viewport.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
tests/weston-test-client-helper.c