mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
xwayland: Start Xwayland on connection to either public X11 socket
Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1454 (cherry picked from commit 7b2815077fa1053069e00c0a21b2c3038f4b0d1c) Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1669>
This commit is contained in:
parent
df4b6d4ca5
commit
063db30c50
@ -56,6 +56,9 @@ typedef struct
|
||||
MetaXWaylandConnection private_connection;
|
||||
MetaXWaylandConnection public_connection;
|
||||
|
||||
guint abstract_fd_watch_id;
|
||||
guint unix_fd_watch_id;
|
||||
|
||||
guint xserver_grace_period_id;
|
||||
struct wl_display *wayland_display;
|
||||
struct wl_client *client;
|
||||
|
@ -990,11 +990,16 @@ xdisplay_connection_activity_cb (gint fd,
|
||||
GIOCondition cond,
|
||||
gpointer user_data)
|
||||
{
|
||||
MetaXWaylandManager *manager = user_data;
|
||||
MetaDisplay *display = meta_get_display ();
|
||||
|
||||
meta_display_init_x11 (display, NULL,
|
||||
(GAsyncReadyCallback) on_init_x11_cb, NULL);
|
||||
|
||||
/* Stop watching both file descriptors */
|
||||
g_clear_handle_id (&manager->abstract_fd_watch_id, g_source_remove);
|
||||
g_clear_handle_id (&manager->unix_fd_watch_id, g_source_remove);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
@ -1098,8 +1103,12 @@ meta_xwayland_init (MetaXWaylandManager *manager,
|
||||
|
||||
if (policy == META_DISPLAY_POLICY_ON_DEMAND)
|
||||
{
|
||||
g_unix_fd_add (manager->public_connection.abstract_fd, G_IO_IN,
|
||||
xdisplay_connection_activity_cb, manager);
|
||||
manager->abstract_fd_watch_id =
|
||||
g_unix_fd_add (manager->public_connection.abstract_fd, G_IO_IN,
|
||||
xdisplay_connection_activity_cb, manager);
|
||||
manager->unix_fd_watch_id =
|
||||
g_unix_fd_add (manager->public_connection.unix_fd, G_IO_IN,
|
||||
xdisplay_connection_activity_cb, manager);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
Loading…
Reference in New Issue
Block a user