test/utils: Make (WAYLAND_)DISPLAY passing to client optional

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2237>
This commit is contained in:
Jonas Ådahl 2022-01-14 22:07:42 +01:00 committed by Marge Bot
parent 1886785b3d
commit 1f758dd78c

View File

@ -477,12 +477,19 @@ meta_test_client_new (MetaContext *context,
wayland_display_name = meta_wayland_get_wayland_display_name (compositor); wayland_display_name = meta_wayland_get_wayland_display_name (compositor);
x11_display_name = meta_wayland_get_public_xwayland_display_name (compositor); x11_display_name = meta_wayland_get_public_xwayland_display_name (compositor);
g_subprocess_launcher_setenv (launcher, if (wayland_display_name)
"WAYLAND_DISPLAY", wayland_display_name, {
TRUE); g_subprocess_launcher_setenv (launcher,
g_subprocess_launcher_setenv (launcher, "WAYLAND_DISPLAY", wayland_display_name,
"DISPLAY", x11_display_name, TRUE);
TRUE); }
if (x11_display_name)
{
g_subprocess_launcher_setenv (launcher,
"DISPLAY", x11_display_name,
TRUE);
}
subprocess = g_subprocess_launcher_spawn (launcher, subprocess = g_subprocess_launcher_spawn (launcher,
error, error,