mirror of
https://github.com/brl/mutter.git
synced 2025-02-02 06:42:28 +00:00
x11: Initialize GdkDisplay together with MetaX11Display
It's no longer a "singleton", since it might be closed and opened again. https://gitlab.gnome.org/GNOME/mutter/merge_requests/420
This commit is contained in:
parent
7713006f5b
commit
1cf4279745
@ -606,22 +606,6 @@ meta_init (void)
|
||||
meta_fatal ("Can't specify both SM save file and SM client id\n");
|
||||
|
||||
meta_main_loop = g_main_loop_new (NULL, FALSE);
|
||||
|
||||
/*
|
||||
* We need to make sure the first client connecting to the X server
|
||||
* (e.g. Xwayland started from meta_wayland_init() above) is a permanent one,
|
||||
* so prepare the GDK X11 connection now already. Without doing this, if
|
||||
* there are any functionality that relies on X11 after here before
|
||||
* meta_display_open(), the X server will terminate itself when such a client
|
||||
* disconnects before the permanent GDK client connects.
|
||||
*/
|
||||
if (meta_should_autostart_x11_display ())
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!meta_x11_init_gdk_display (&error))
|
||||
g_error ("Failed to open X11 display: %s", error->message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1110,6 +1110,9 @@ meta_x11_display_new (MetaDisplay *display, GError **error)
|
||||
};
|
||||
Atom atoms[G_N_ELEMENTS(atom_names)];
|
||||
|
||||
if (!meta_x11_init_gdk_display (error))
|
||||
return NULL;
|
||||
|
||||
g_assert (prepared_gdk_display);
|
||||
gdk_display = g_steal_pointer (&prepared_gdk_display);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user