diff --git a/src/compositor.c b/src/compositor.c index 200e26c5..4a5e51c9 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -2117,12 +2117,12 @@ int main(int argc, char *argv[]) ec->option_idle_time = option_idle_time; ec->idle_time = option_idle_time; - if (shell_init(ec) < 0) - exit(EXIT_FAILURE); - if (xserver) weston_xserver_init(ec); + if (shell_init(ec) < 0) + exit(EXIT_FAILURE); + if (wl_display_add_socket(display, option_socket_name)) { fprintf(stderr, "failed to add socket: %m\n"); exit(EXIT_FAILURE); diff --git a/src/xserver-launcher.c b/src/xserver-launcher.c index 5ff472f9..c7b8e983 100644 --- a/src/xserver-launcher.c +++ b/src/xserver-launcher.c @@ -1610,7 +1610,7 @@ weston_xserver_init(struct weston_compositor *compositor) { struct wl_display *display = compositor->wl_display; struct weston_xserver *mxs; - char lockfile[256]; + char lockfile[256], display_name[8]; mxs = malloc(sizeof *mxs); memset(mxs, 0, sizeof *mxs); @@ -1649,7 +1649,9 @@ weston_xserver_init(struct weston_compositor *compositor) return -1; } - fprintf(stderr, "xserver listening on display :%d\n", mxs->display); + snprintf(display_name, sizeof display_name, ":%d", mxs->display); + fprintf(stderr, "xserver listening on display %s\n", display_name); + setenv("DISPLAY", display_name, 1); mxs->loop = wl_display_get_event_loop(display); mxs->abstract_source =