From ffd02d9b26bd560849c407a6dd4f5c4d7d2c1736 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 XDG-WM-Base 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 XDG-WM-Base protocol. Check for XDG-WM-Base protocol support at startup and exit cleanly if missing rather than segfaulting later in ensure_surface_for_window() while trying to use xdg_wm_base_get_xdg_surface(). Signed-off-by: Olivier Fourdan Reviewed-by: Michel Dänzer Reviewed-by: Simon Ser --- hw/xwayland/xwayland-screen.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/xwayland/xwayland-screen.c b/hw/xwayland/xwayland-screen.c index bc6751be7..c18e2fbb5 100644 --- a/hw/xwayland/xwayland-screen.c +++ b/hw/xwayland/xwayland-screen.c @@ -635,6 +635,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->xdg_wm_base) { + ErrorF("missing XDG-WM-Base protocol\n"); + return FALSE; + } + bpc = xwl_screen->depth / 3; green_bpc = xwl_screen->depth - 2 * bpc; blue_mask = (1 << bpc) - 1; -- GitLab