xserver: Set DISPLAY for clients launched by the compositor

dev
Kristian Høgsberg 13 years ago
parent ea093d4883
commit 1760ebb236
  1. 6
      src/compositor.c
  2. 6
      src/xserver-launcher.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);

@ -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 =

Loading…
Cancel
Save