Handle xwayland not started (when HAVE_XWAYLAND, but lacking the binary)

Closes https://github.com/labwc/labwc/issues/434
This commit is contained in:
Daniel Lublin 2026-02-25 10:40:39 +01:00
parent 9903331995
commit 2338eb3f8b
5 changed files with 37 additions and 14 deletions

View file

@ -1218,8 +1218,9 @@ xwayland_server_init(struct wlr_compositor *compositor)
wlr_xwayland_create(server.wl_display,
compositor, /* lazy */ !rc.xwayland_persistence);
if (!server.xwayland) {
wlr_log(WLR_ERROR, "cannot create xwayland server");
exit(EXIT_FAILURE);
wlr_log(WLR_ERROR, "failed to create xwayland server, continuing without");
unsetenv("DISPLAY");
return;
}
server.xwayland_new_surface.notify = handle_new_surface;
wl_signal_add(&server.xwayland->events.new_surface,
@ -1308,6 +1309,11 @@ void
xwayland_server_finish(void)
{
struct wlr_xwayland *xwayland = server.xwayland;
if (!xwayland) {
return;
}
wl_list_remove(&server.xwayland_new_surface.link);
wl_list_remove(&server.xwayland_server_ready.link);
wl_list_remove(&server.xwayland_xwm_ready.link);