xwayland: Fix xwayland
Don't give us a freed pointer here.
This commit is contained in:
parent
8566566451
commit
d694260ad2
@ -68,6 +68,7 @@ typedef struct
|
|||||||
pid_t pid;
|
pid_t pid;
|
||||||
struct wl_client *client;
|
struct wl_client *client;
|
||||||
struct wl_resource *xserver_resource;
|
struct wl_resource *xserver_resource;
|
||||||
|
char *display_name;
|
||||||
|
|
||||||
GMainLoop *init_loop;
|
GMainLoop *init_loop;
|
||||||
} MetaXWaylandManager;
|
} MetaXWaylandManager;
|
||||||
|
@ -623,7 +623,6 @@ meta_wayland_init (void)
|
|||||||
{
|
{
|
||||||
MetaWaylandCompositor *compositor = &_meta_wayland_compositor;
|
MetaWaylandCompositor *compositor = &_meta_wayland_compositor;
|
||||||
MetaMonitorManager *monitors;
|
MetaMonitorManager *monitors;
|
||||||
char *display_name;
|
|
||||||
int drm_fd;
|
int drm_fd;
|
||||||
|
|
||||||
memset (compositor, 0, sizeof (MetaWaylandCompositor));
|
memset (compositor, 0, sizeof (MetaWaylandCompositor));
|
||||||
@ -720,11 +719,10 @@ meta_wayland_init (void)
|
|||||||
* and so EGL must be initialized by this point.
|
* 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");
|
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);
|
set_gnome_env ("WAYLAND_DISPLAY", compositor->display_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,8 +26,7 @@
|
|||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
meta_xwayland_start (MetaXWaylandManager *manager,
|
meta_xwayland_start (MetaXWaylandManager *manager,
|
||||||
struct wl_display *display,
|
struct wl_display *display);
|
||||||
char **display_name_out);
|
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_xwayland_complete_init (void);
|
meta_xwayland_complete_init (void);
|
||||||
|
@ -286,8 +286,7 @@ x_io_error (Display *display)
|
|||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
meta_xwayland_start (MetaXWaylandManager *manager,
|
meta_xwayland_start (MetaXWaylandManager *manager,
|
||||||
struct wl_display *wl_display,
|
struct wl_display *wl_display)
|
||||||
char **display_name_out)
|
|
||||||
{
|
{
|
||||||
int display = 0;
|
int display = 0;
|
||||||
char *lockfile = NULL;
|
char *lockfile = NULL;
|
||||||
@ -295,7 +294,6 @@ meta_xwayland_start (MetaXWaylandManager *manager,
|
|||||||
pid_t pid;
|
pid_t pid;
|
||||||
char **env;
|
char **env;
|
||||||
char *fd_string;
|
char *fd_string;
|
||||||
char *display_name;
|
|
||||||
char *log_path;
|
char *log_path;
|
||||||
char *args[11];
|
char *args[11];
|
||||||
GError *error;
|
GError *error;
|
||||||
@ -356,11 +354,11 @@ meta_xwayland_start (MetaXWaylandManager *manager,
|
|||||||
env = g_environ_setenv (env, "WAYLAND_SOCKET", fd_string, TRUE);
|
env = g_environ_setenv (env, "WAYLAND_SOCKET", fd_string, TRUE);
|
||||||
g_free (fd_string);
|
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);
|
log_path = g_build_filename (g_get_user_cache_dir (), "xwayland.log", NULL);
|
||||||
|
|
||||||
args[0] = XWAYLAND_PATH;
|
args[0] = XWAYLAND_PATH;
|
||||||
args[1] = display_name;
|
args[1] = manager->display_name;
|
||||||
args[2] = "-wayland";
|
args[2] = "-wayland";
|
||||||
args[3] = "-rootless";
|
args[3] = "-rootless";
|
||||||
args[4] = "-retro";
|
args[4] = "-retro";
|
||||||
@ -398,7 +396,6 @@ meta_xwayland_start (MetaXWaylandManager *manager,
|
|||||||
}
|
}
|
||||||
|
|
||||||
g_strfreev (env);
|
g_strfreev (env);
|
||||||
g_free (display_name);
|
|
||||||
g_free (log_path);
|
g_free (log_path);
|
||||||
|
|
||||||
/* We need to run a mainloop until we know xwayland has a binding
|
/* 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);
|
manager->init_loop = g_main_loop_new (NULL, FALSE);
|
||||||
g_main_loop_run (manager->init_loop);
|
g_main_loop_run (manager->init_loop);
|
||||||
|
|
||||||
*display_name_out = display_name;
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user