[mutter] wayland: Set the xdg_popup pointer even when not mapping



commit d6d377a44754520695f1fa558e21e8780c93b815
Author: Jonas Ådahl <jadahl gmail com>
Date:   Fri Oct 16 09:40:21 2015 +0800

    wayland: Set the xdg_popup pointer even when not mapping
    
    If we immediately dismiss the popup, we still need to set the
    surface->xdg_popup pointer field in order for the destructor to
    properly clean up the state. Not doing this may cause a crash if the
    xdg_popup resource that was immediately dismissed is destoryed after
    wl_surface during client destruction.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756675

 src/wayland/meta-wayland-surface.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index f51b124..ba21d77 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -1515,15 +1515,15 @@ xdg_shell_get_xdg_popup (struct wl_client *client,
                                   surface,
                                   xdg_popup_destructor);
 
+  surface->xdg_popup = popup_resource;
+  surface->xdg_shell_resource = resource;
+
   if (!meta_wayland_pointer_can_popup (&seat->pointer, serial))
     {
       xdg_popup_send_popup_done (popup_resource);
       return;
     }
 
-  surface->xdg_popup = popup_resource;
-  surface->xdg_shell_resource = resource;
-
   surface->popup.parent = parent_surf;
   surface->popup.parent_destroy_listener.notify = handle_popup_parent_destroyed;
   wl_resource_add_destroy_listener (parent_surf->resource,


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