backend-wayland: Abort early when wl_shm isn’t advertised

This prevents a segfault in libwayland-cursor when the parent compositor
doesn’t have any of the needed protocols implemented.

Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
This commit is contained in:
Emmanuel Gil Peyrot 2021-02-11 23:20:34 +01:00
parent 557dea5660
commit 0b48e6b5ca

View File

@ -2760,6 +2760,11 @@ wayland_backend_create(struct weston_compositor *compositor,
wl_registry_add_listener(b->parent.registry, &registry_listener, b);
wl_display_roundtrip(b->parent.wl_display);
if (b->parent.shm == NULL) {
weston_log("Error: Failed to retrieve wl_shm from parent Wayland compositor\n");
goto err_display;
}
create_cursor(b, new_config);
#ifdef ENABLE_EGL