Commit bd624e4d authored by Jonas Ådahl's avatar Jonas Ådahl

tests: Override X11 display number

As with the Wayland display name, to avoid clashes with already an
running Xwayland or Xorg instance, override the X11 display name to
something less likely to cause a clash.

#193
parent fe1d9fb4
......@@ -27,6 +27,7 @@
#include "core/display-private.h"
#include "core/window-private.h"
#include "wayland/meta-wayland.h"
#include "wayland/meta-xwayland.h"
#include "x11/meta-x11-display-private.h"
struct _TestClient {
......@@ -94,6 +95,7 @@ test_init (int *argc,
ensure_test_client_path (*argc, *argv);
meta_wayland_override_display_name ("mutter-test-display");
meta_xwayland_override_display_number (512);
}
AsyncWaiter *
......
......@@ -59,6 +59,8 @@ G_DEFINE_TYPE (MetaWaylandSurfaceRoleXWayland,
meta_wayland_surface_role_xwayland,
META_TYPE_WAYLAND_ACTOR_SURFACE)
static int display_number_override = -1;
void
meta_xwayland_associate_window_with_surface (MetaWindow *window,
MetaWaylandSurface *surface)
......@@ -371,6 +373,12 @@ x_io_error (Display *display)
return 0;
}
void
meta_xwayland_override_display_number (int number)
{
display_number_override = number;
}
static gboolean
choose_xdisplay (MetaXWaylandManager *manager)
{
......@@ -378,11 +386,9 @@ choose_xdisplay (MetaXWaylandManager *manager)
char *lock_file = NULL;
gboolean fatal = FALSE;
/* Hack to keep the unused Xwayland instance on
* the login screen from taking the prime :0 display
* number.
*/
if (g_getenv ("RUNNING_UNDER_GDM") != NULL)
if (display_number_override != -1)
display = display_number_override;
else if (!g_getenv ("RUNNING_UNDER_GDM"))
display = 1024;
do
......
......@@ -30,6 +30,9 @@
#include "meta/types.h"
#include "wayland/meta-wayland-types.h"
void
meta_xwayland_override_display_number (int number);
void
meta_xwayland_handle_wl_surface_id (MetaWindow *window,
guint32 surface_id);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment