From 0811a9ff783c252b3e4d558bf31c6b066b0633e1 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Mon, 2 Nov 2020 15:44:31 +0100 Subject: [PATCH] xwayland: non-rootless requires the wl_shell protocol MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When running non-rootless, Xwayland requires that the Wayland compositor supports the wl_shell protocol. Check for wl_shell protocol support at startup and exit cleanly if missing rather than segfaulting later in ensure_surface_for_window() while trying to use wl_shell_get_shell_surface(). Signed-off-by: Olivier Fourdan Reviewed-by: Michel Dänzer Reviewed-by: Simon Ser (cherry picked from commit ffd02d9b26bd560849c407a6dd4f5c4d7d2c1736) --- hw/xwayland/xwayland.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c index a69188c0f..21434c6e5 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c @@ -1202,6 +1202,11 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) ®istry_listener, xwl_screen); xwl_screen_roundtrip(xwl_screen); + if (!xwl_screen->rootless && !xwl_screen->shell) { + ErrorF("missing wl_shell protocol\n"); + return FALSE; + } + bpc = xwl_screen->depth / 3; green_bpc = xwl_screen->depth - 2 * bpc; blue_mask = (1 << bpc) - 1;