From 9b797fb98eadae2c10740c706d3191bbc5a23e59 Mon Sep 17 00:00:00 2001 From: Jente Hidskes Date: Thu, 17 Jan 2019 22:25:20 +0100 Subject: [PATCH] Cage: move xwayland check --- cage.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cage.c b/cage.c index bd122b1..dd79f7e 100644 --- a/cage.c +++ b/cage.c @@ -183,6 +183,11 @@ main(int argc, char *argv[]) #if CAGE_HAS_XWAYLAND xwayland = wlr_xwayland_create(server.wl_display, compositor, true); + if (!xwayland) { + wlr_log(WLR_ERROR, "Cannot create XWayland server"); + ret = 1; + goto end; + } server.new_xwayland_surface.notify = handle_xwayland_surface_new; wl_signal_add(&xwayland->events.new_surface, &server.new_xwayland_surface); @@ -227,9 +232,7 @@ main(int argc, char *argv[]) } #if CAGE_HAS_XWAYLAND - if (xwayland) { - wlr_xwayland_set_seat(xwayland, server.seat->seat); - } + wlr_xwayland_set_seat(xwayland, server.seat->seat); #endif pid_t pid;