From abd368be0066e7e0d3162a7a781bb1b6099323ec Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Tue, 19 Nov 2013 20:20:13 -0500 Subject: [PATCH] pointer: Don't send leave events to dying surfaces It's invalid and will crash the client. --- src/wayland/meta-wayland-pointer.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c index beb85c83d..9a5680e74 100644 --- a/src/wayland/meta-wayland-pointer.c +++ b/src/wayland/meta-wayland-pointer.c @@ -303,8 +303,11 @@ meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer, struct wl_resource *resource, *kr; uint32_t serial; + if (pointer->focus == surface) + return; + resource = pointer->focus_resource; - if (resource && pointer->focus != surface) + if (resource && pointer->focus->resource) { struct wl_client *client = wl_resource_get_client (resource); struct wl_display *display = wl_client_get_display (client); @@ -313,8 +316,7 @@ meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer, } resource = find_resource_for_surface (&pointer->resource_list, surface); - if (resource && - (pointer->focus != surface || pointer->focus_resource != resource)) + if (resource) { struct wl_client *client = wl_resource_get_client (resource); struct wl_display *display = wl_client_get_display (client);