From 3b7c207d06bbf24827021d3da77f9baa764974f4 Mon Sep 17 00:00:00 2001 From: Dima Ryazanov Date: Wed, 30 Nov 2016 12:10:55 -0800 Subject: [PATCH] window: Check for NULL surface in keyboard_handle_enter This can happen if you right-click in weston-terminal a few times very quickly. The pointer_handle_enter callback already checks for NULL, so let's do that in keyboard_handle_enter, too. Signed-off-by: Dima Ryazanov Reviewed-by: Daniel Stone --- clients/window.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/clients/window.c b/clients/window.c index d75bc60d1..59fc07e30 100644 --- a/clients/window.c +++ b/clients/window.c @@ -3084,6 +3084,11 @@ keyboard_handle_enter(void *data, struct wl_keyboard *keyboard, struct input *input = data; struct window *window; + if (!surface) { + /* enter event for a window we've just destroyed */ + return; + } + input->display->serial = serial; input->keyboard_focus = wl_surface_get_user_data(surface);