From 8f180d44f554a9ab23e51e3d2c4338e64338c63f Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Sat, 7 Dec 2013 13:49:28 -0500 Subject: [PATCH] shell: Fix set_transient_for with a NULL parent --- desktop-shell/shell.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c index f95212460..5f6bd6d62 100644 --- a/desktop-shell/shell.c +++ b/desktop-shell/shell.c @@ -1855,8 +1855,12 @@ xdg_surface_set_transient_for(struct wl_client *client, struct wl_resource *parent_resource) { struct shell_surface *shsurf = wl_resource_get_user_data(resource); - struct weston_surface *parent = - wl_resource_get_user_data(parent_resource); + struct weston_surface *parent; + + if (parent_resource) + parent = wl_resource_get_user_data(parent_resource); + else + parent = NULL; shell_surface_set_parent(shsurf, parent); }