summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorOlivier Fourdan <ofourdan@redhat.com>2020-11-02 15:44:31 +0100
committerOlivier Fourdan <ofourdan@redhat.com>2020-11-09 11:35:30 +0100
commit0811a9ff783c252b3e4d558bf31c6b066b0633e1 (patch)
treebad5eeebb6fc3f82c149b6cae6257769d3ae93c7 /hw
parentb3ae038c32870a4a1bb42b6e1cf2ebedc8b7bc8d (diff)
xwayland: non-rootless requires the wl_shell protocol
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 <ofourdan@redhat.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com> Reviewed-by: Simon Ser <contact@emersion.fr> (cherry picked from commit ffd02d9b26bd560849c407a6dd4f5c4d7d2c1736)
Diffstat (limited to 'hw')
-rw-r--r--hw/xwayland/xwayland.c5
1 files changed, 5 insertions, 0 deletions
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)
&registry_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;