Add beter handling for Xwayland failing at startup

This commit is contained in:
Vincent Vanlaer 2018-05-07 00:43:26 +02:00
parent dbf4f9a231
commit 446ea3a340

View file

@ -178,18 +178,26 @@ static void handle_client_destroy(struct wl_listener *listener, void *data) {
struct wlr_xwayland *wlr_xwayland = struct wlr_xwayland *wlr_xwayland =
wl_container_of(listener, wlr_xwayland, client_destroy); wl_container_of(listener, wlr_xwayland, client_destroy);
if (wlr_xwayland->sigusr1_source) {
// Xwayland failed to start, let the sigusr1 handler deal with it
return;
}
// Don't call client destroy: it's being destroyed already // Don't call client destroy: it's being destroyed already
wlr_xwayland->client = NULL; wlr_xwayland->client = NULL;
wl_list_remove(&wlr_xwayland->client_destroy.link); wl_list_remove(&wlr_xwayland->client_destroy.link);
xwayland_finish_server(wlr_xwayland); xwayland_finish_server(wlr_xwayland);
if (time(NULL) - wlr_xwayland->server_start > 5) {
if (wlr_xwayland->lazy) { if (wlr_xwayland->lazy) {
wlr_log(L_INFO, "Restarting Xwayland (lazy)");
xwayland_start_server_lazy(wlr_xwayland); xwayland_start_server_lazy(wlr_xwayland);
} else if (time(NULL) - wlr_xwayland->server_start > 5) { } else {
wlr_log(L_INFO, "Restarting Xwayland"); wlr_log(L_INFO, "Restarting Xwayland");
xwayland_start_server(wlr_xwayland); xwayland_start_server(wlr_xwayland);
} }
}
} }
static void handle_display_destroy(struct wl_listener *listener, void *data) { static void handle_display_destroy(struct wl_listener *listener, void *data) {