xwayland: don't set DISPLAY

Let the compositor set it. This allows for multiple Xwayland instances to run
at the same time.

Fixes https://github.com/swaywm/wlroots/issues/1442
This commit is contained in:
emersion 2019-03-02 15:14:23 +01:00 committed by Drew DeVault
parent fb106eb979
commit 9601019192
3 changed files with 10 additions and 13 deletions

View file

@ -165,12 +165,9 @@ static void xwayland_finish_display(struct wlr_xwayland *wlr_xwayland) {
unlink_display_sockets(wlr_xwayland->display);
wlr_xwayland->display = -1;
unsetenv("DISPLAY");
wlr_xwayland->display_name[0] = '\0';
}
static bool xwayland_start_display(struct wlr_xwayland *wlr_xwayland,
struct wl_display *wl_display);
static bool xwayland_start_server(struct wlr_xwayland *wlr_xwayland);
static bool xwayland_start_server_lazy(struct wlr_xwayland *wlr_xwayland);
@ -284,10 +281,8 @@ static bool xwayland_start_display(struct wlr_xwayland *wlr_xwayland,
return false;
}
char display_name[16];
snprintf(display_name, sizeof(display_name), ":%d", wlr_xwayland->display);
setenv("DISPLAY", display_name, true);
snprintf(wlr_xwayland->display_name, sizeof(wlr_xwayland->display_name),
":%d", wlr_xwayland->display);
return true;
}