xwayland: Split Xwayland display name getter into two

One for the public channel, and one for the private maintainance
channel. Use the public one for test clients, otherwise tests become
flaky, and the private one for MetaX11Display.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1681>
This commit is contained in:
Jonas Ådahl 2021-01-21 18:56:18 +01:00 committed by Marge Bot
parent fb38c451b5
commit d8e75027a4
4 changed files with 12 additions and 4 deletions

View File

@ -440,7 +440,7 @@ test_client_new (const char *id,
g_assert (meta_is_wayland_compositor ());
compositor = meta_wayland_compositor_get_default ();
wayland_display_name = meta_wayland_get_wayland_display_name (compositor);
x11_display_name = meta_wayland_get_xwayland_display_name (compositor);
x11_display_name = meta_wayland_get_public_xwayland_display_name (compositor);
g_subprocess_launcher_setenv (launcher,
"WAYLAND_DISPLAY", wayland_display_name,

View File

@ -503,7 +503,13 @@ meta_wayland_get_wayland_display_name (MetaWaylandCompositor *compositor)
}
const char *
meta_wayland_get_xwayland_display_name (MetaWaylandCompositor *compositor)
meta_wayland_get_public_xwayland_display_name (MetaWaylandCompositor *compositor)
{
return compositor->xwayland_manager.public_connection.name;
}
const char *
meta_wayland_get_private_xwayland_display_name (MetaWaylandCompositor *compositor)
{
return compositor->xwayland_manager.private_connection.name;
}

View File

@ -70,7 +70,9 @@ META_EXPORT_TEST
const char *meta_wayland_get_wayland_display_name (MetaWaylandCompositor *compositor);
META_EXPORT_TEST
const char *meta_wayland_get_xwayland_display_name (MetaWaylandCompositor *compositor);
const char *meta_wayland_get_public_xwayland_display_name (MetaWaylandCompositor *compositor);
const char *meta_wayland_get_private_xwayland_display_name (MetaWaylandCompositor *compositor);
void meta_wayland_compositor_restore_shortcuts (MetaWaylandCompositor *compositor,
ClutterInputDevice *source);

View File

@ -1044,7 +1044,7 @@ meta_x11_get_display_name (void)
compositor = meta_wayland_compositor_get_default ();
return meta_wayland_get_xwayland_display_name (compositor);
return meta_wayland_get_private_xwayland_display_name (compositor);
}
else
#endif