Due to race conditions, it is (vanishingly unlikely but) possible to
receive a wl_pointer.enter event referring to a wl_surface we have just
destroyed. If this happens, wl_surface will be NULL. Detect this, clear
out our focus, and return.
Other pointer and keyboard events are robust against destroyed surfaces.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Cc: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
[Pekka: remove call to input_set_cursor()]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
enum theme_location location;
double x, y;
+ if (!surface) {
+ input->output = NULL;
+ input->has_focus = false;
+ notify_pointer_focus(&input->base, NULL, 0, 0);
+ return;
+ }
+
x = wl_fixed_to_double(fixed_x);
y = wl_fixed_to_double(fixed_y);