libweston-desktop: don't crash when getting the pid for X clients
X client's don't have a wl_client associated with their
weston_desktop_client, so make sure to not use it.
Signed-off-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
diff --git a/libweston-desktop/xwayland.c b/libweston-desktop/xwayland.c
index baacf7b..6b90c14 100644
--- a/libweston-desktop/xwayland.c
+++ b/libweston-desktop/xwayland.c
@@ -241,6 +241,8 @@
wl_resource_add_destroy_listener(wsurface->resource,
&surface->resource_destroy_listener);
+ weston_desktop_surface_set_pid(surface->surface, 0);
+
return surface;
}