Unset DISPLAY when wlr_xwayland fails

Avoids having applications connect to a leftover DISPLAY when Xwayland
fails to initialize.
This commit is contained in:
Simon Ser 2020-07-02 13:50:24 +02:00 committed by Tudor Brindus
parent dfccd2a4c4
commit eb4fa18308

View file

@ -202,6 +202,7 @@ bool server_start(struct sway_server *server) {
config->xwayland == XWAYLAND_MODE_LAZY); config->xwayland == XWAYLAND_MODE_LAZY);
if (!server->xwayland.wlr_xwayland) { if (!server->xwayland.wlr_xwayland) {
sway_log(SWAY_ERROR, "Failed to start Xwayland"); sway_log(SWAY_ERROR, "Failed to start Xwayland");
unsetenv("DISPLAY");
} else { } else {
wl_signal_add(&server->xwayland.wlr_xwayland->events.new_surface, wl_signal_add(&server->xwayland.wlr_xwayland->events.new_surface,
&server->xwayland_surface); &server->xwayland_surface);