[mutter/wayland] pointer: Don't send leave events to dying surfaces



commit abd368be0066e7e0d3162a7a781bb1b6099323ec
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Nov 19 20:20:13 2013 -0500

    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 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c
index beb85c8..9a5680e 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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]