summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2015-10-16 09:40:21 +0800
committerJonas Ådahl <jadahl@gmail.com>2015-10-16 11:31:51 +0800
commitd6d377a44754520695f1fa558e21e8780c93b815 (patch)
tree6e2a54d11731be7145bc5eb0968435c844fb666c
parentffd95c2ad594f7433d90b557ad4ed27eef98abf4 (diff)
downloadmutter-d6d377a44754520695f1fa558e21e8780c93b815.tar.gz
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
-rw-r--r--src/wayland/meta-wayland-surface.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index f51b124e6..ba21d77a0 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,