From 0481054c584165e2a2377a0ed4257c339ef32ade Mon Sep 17 00:00:00 2001 From: Giulio Camuffo Date: Mon, 23 Sep 2013 12:33:39 +0200 Subject: [PATCH] input: check that the new focus surface has a valid resource Here too we must make sure the surface has a valid resource, as there are some (xwayland, surfaces created by the shell) that don't have it. Fix a Weston crash when setting a mpv window fullscreen on drm. --- src/input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/input.c b/src/input.c index 01ec059e..1313b526 100644 --- a/src/input.c +++ b/src/input.c @@ -503,7 +503,7 @@ weston_pointer_set_focus(struct weston_pointer *pointer, pointer->focus_serial = serial; } - if (kbd && surface && kbd->focus != pointer->focus) { + if (kbd && surface && surface->resource && kbd->focus != pointer->focus) { struct wl_client *surface_client = wl_resource_get_client(surface->resource); send_modifiers_to_client_in_list(surface_client,