From a37a8c64972f392013b6101bcd6205a6ceb6a14f Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Thu, 21 Nov 2013 13:09:13 -0500 Subject: [PATCH] wayland-surface: Fix transient_for It takes a wl_surface resource, not an xdg_shell_surface resource, and the argument is allowed to be NULL. --- src/wayland/meta-wayland-surface.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c index 3a2858498..71e3512a1 100644 --- a/src/wayland/meta-wayland-surface.c +++ b/src/wayland/meta-wayland-surface.c @@ -524,14 +524,19 @@ xdg_surface_destroy (struct wl_client *client, static void xdg_surface_set_transient_for (struct wl_client *client, struct wl_resource *resource, - struct wl_resource *parent) + struct wl_resource *parent_resource) { MetaWaylandSurfaceExtension *xdg_surface = wl_resource_get_user_data (resource); MetaWaylandSurface *surface = wl_container_of (xdg_surface, surface, xdg_surface); - MetaWaylandSurfaceExtension *parent_xdg_surface = wl_resource_get_user_data (parent); - MetaWaylandSurface *parent_surface = wl_container_of (parent_xdg_surface, surface, xdg_surface); + MetaWindow *transient_for = NULL; - meta_window_set_transient_for (surface->window, parent_surface->window); + if (parent_resource) + { + MetaWaylandSurface *parent_surface = wl_resource_get_user_data (parent_resource); + transient_for = parent_surface->window; + } + + meta_window_set_transient_for (surface->window, transient_for); } static void