diff --git a/src/wayland/meta-wayland-private.h b/src/wayland/meta-wayland-private.h index f12fff66b..cba6ed397 100644 --- a/src/wayland/meta-wayland-private.h +++ b/src/wayland/meta-wayland-private.h @@ -68,6 +68,7 @@ typedef struct pid_t pid; struct wl_client *client; struct wl_resource *xserver_resource; + char *display_name; GMainLoop *init_loop; } MetaXWaylandManager; diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c index 22de96543..254b4d09b 100644 --- a/src/wayland/meta-wayland.c +++ b/src/wayland/meta-wayland.c @@ -623,7 +623,6 @@ meta_wayland_init (void) { MetaWaylandCompositor *compositor = &_meta_wayland_compositor; MetaMonitorManager *monitors; - char *display_name; int drm_fd; memset (compositor, 0, sizeof (MetaWaylandCompositor)); @@ -720,11 +719,10 @@ meta_wayland_init (void) * and so EGL must be initialized by this point. */ - if (!meta_xwayland_start (&compositor->xwayland_manager, compositor->wayland_display, &display_name)) + if (!meta_xwayland_start (&compositor->xwayland_manager, compositor->wayland_display)) g_error ("Failed to start X Wayland"); - set_gnome_env ("DISPLAY", display_name); - + set_gnome_env ("DISPLAY", compositor->xwayland_manager.display_name); set_gnome_env ("WAYLAND_DISPLAY", compositor->display_name); } diff --git a/src/wayland/meta-xwayland-private.h b/src/wayland/meta-xwayland-private.h index 721debfad..83b2986d3 100644 --- a/src/wayland/meta-xwayland-private.h +++ b/src/wayland/meta-xwayland-private.h @@ -25,9 +25,8 @@ #include gboolean -meta_xwayland_start (MetaXWaylandManager *manager, - struct wl_display *display, - char **display_name_out); +meta_xwayland_start (MetaXWaylandManager *manager, + struct wl_display *display); void meta_xwayland_complete_init (void); diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c index 89025af34..753af7885 100644 --- a/src/wayland/meta-xwayland.c +++ b/src/wayland/meta-xwayland.c @@ -285,9 +285,8 @@ x_io_error (Display *display) } gboolean -meta_xwayland_start (MetaXWaylandManager *manager, - struct wl_display *wl_display, - char **display_name_out) +meta_xwayland_start (MetaXWaylandManager *manager, + struct wl_display *wl_display) { int display = 0; char *lockfile = NULL; @@ -295,7 +294,6 @@ meta_xwayland_start (MetaXWaylandManager *manager, pid_t pid; char **env; char *fd_string; - char *display_name; char *log_path; char *args[11]; GError *error; @@ -356,11 +354,11 @@ meta_xwayland_start (MetaXWaylandManager *manager, env = g_environ_setenv (env, "WAYLAND_SOCKET", fd_string, TRUE); g_free (fd_string); - display_name = g_strdup_printf (":%d", manager->display_index); + manager->display_name = g_strdup_printf (":%d", manager->display_index); log_path = g_build_filename (g_get_user_cache_dir (), "xwayland.log", NULL); args[0] = XWAYLAND_PATH; - args[1] = display_name; + args[1] = manager->display_name; args[2] = "-wayland"; args[3] = "-rootless"; args[4] = "-retro"; @@ -398,7 +396,6 @@ meta_xwayland_start (MetaXWaylandManager *manager, } g_strfreev (env); - g_free (display_name); g_free (log_path); /* We need to run a mainloop until we know xwayland has a binding @@ -407,8 +404,6 @@ meta_xwayland_start (MetaXWaylandManager *manager, manager->init_loop = g_main_loop_new (NULL, FALSE); g_main_loop_run (manager->init_loop); - *display_name_out = display_name; - return TRUE; }