From 9601019192a411aca889db48e6dc6c856d1e2a64 Mon Sep 17 00:00:00 2001 From: emersion Date: Sat, 2 Mar 2019 15:14:23 +0100 Subject: 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 --- xwayland/xwayland.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'xwayland/xwayland.c') diff --git a/xwayland/xwayland.c b/xwayland/xwayland.c index c01acb33..015c33e7 100644 --- a/xwayland/xwayland.c +++ b/xwayland/xwayland.c @@ -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; } -- cgit v1.2.3