wayland: Guard XWayland types
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2445>
This commit is contained in:
parent
0f88f0931c
commit
a27b9d9707
@ -934,12 +934,12 @@ meta_display_new (MetaContext *context,
|
|||||||
#ifdef HAVE_WAYLAND
|
#ifdef HAVE_WAYLAND
|
||||||
if (meta_is_wayland_compositor ())
|
if (meta_is_wayland_compositor ())
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
MetaWaylandCompositor *wayland_compositor =
|
MetaWaylandCompositor *wayland_compositor =
|
||||||
wayland_compositor_from_display (display);
|
wayland_compositor_from_display (display);
|
||||||
|
|
||||||
meta_wayland_compositor_init_display (wayland_compositor, display);
|
meta_wayland_compositor_init_display (wayland_compositor, display);
|
||||||
|
|
||||||
#ifdef HAVE_XWAYLAND
|
|
||||||
MetaX11DisplayPolicy x11_display_policy;
|
MetaX11DisplayPolicy x11_display_policy;
|
||||||
|
|
||||||
x11_display_policy = meta_context_get_x11_display_policy (context);
|
x11_display_policy = meta_context_get_x11_display_policy (context);
|
||||||
|
@ -613,7 +613,9 @@ meta_test_client_new (MetaContext *context,
|
|||||||
ClientProcessHandler *process_handler;
|
ClientProcessHandler *process_handler;
|
||||||
MetaWaylandCompositor *compositor;
|
MetaWaylandCompositor *compositor;
|
||||||
const char *wayland_display_name;
|
const char *wayland_display_name;
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
const char *x11_display_name;
|
const char *x11_display_name;
|
||||||
|
#endif
|
||||||
|
|
||||||
launcher = g_subprocess_launcher_new ((G_SUBPROCESS_FLAGS_STDIN_PIPE |
|
launcher = g_subprocess_launcher_new ((G_SUBPROCESS_FLAGS_STDIN_PIPE |
|
||||||
G_SUBPROCESS_FLAGS_STDOUT_PIPE));
|
G_SUBPROCESS_FLAGS_STDOUT_PIPE));
|
||||||
@ -621,8 +623,9 @@ meta_test_client_new (MetaContext *context,
|
|||||||
g_assert (meta_is_wayland_compositor ());
|
g_assert (meta_is_wayland_compositor ());
|
||||||
compositor = meta_context_get_wayland_compositor (context);
|
compositor = meta_context_get_wayland_compositor (context);
|
||||||
wayland_display_name = meta_wayland_get_wayland_display_name (compositor);
|
wayland_display_name = meta_wayland_get_wayland_display_name (compositor);
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
x11_display_name = meta_wayland_get_public_xwayland_display_name (compositor);
|
x11_display_name = meta_wayland_get_public_xwayland_display_name (compositor);
|
||||||
|
#endif
|
||||||
if (wayland_display_name)
|
if (wayland_display_name)
|
||||||
{
|
{
|
||||||
g_subprocess_launcher_setenv (launcher,
|
g_subprocess_launcher_setenv (launcher,
|
||||||
@ -630,12 +633,14 @@ meta_test_client_new (MetaContext *context,
|
|||||||
TRUE);
|
TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
if (x11_display_name)
|
if (x11_display_name)
|
||||||
{
|
{
|
||||||
g_subprocess_launcher_setenv (launcher,
|
g_subprocess_launcher_setenv (launcher,
|
||||||
"DISPLAY", x11_display_name,
|
"DISPLAY", x11_display_name,
|
||||||
TRUE);
|
TRUE);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
subprocess = g_subprocess_launcher_spawn (launcher,
|
subprocess = g_subprocess_launcher_spawn (launcher,
|
||||||
error,
|
error,
|
||||||
|
@ -474,8 +474,10 @@ should_constraint_be_enabled (MetaWaylandPointerConstraint *constraint)
|
|||||||
* associate the X11 Window with the wl_surface.
|
* associate the X11 Window with the wl_surface.
|
||||||
* For subsurfaces the window of the ancestor might be gone already.
|
* For subsurfaces the window of the ancestor might be gone already.
|
||||||
*/
|
*/
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
g_warn_if_fail (meta_xwayland_is_xwayland_surface (constraint->surface) ||
|
g_warn_if_fail (meta_xwayland_is_xwayland_surface (constraint->surface) ||
|
||||||
META_IS_WAYLAND_SUBSURFACE (constraint->surface->role));
|
META_IS_WAYLAND_SUBSURFACE (constraint->surface->role));
|
||||||
|
#endif
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -92,7 +92,9 @@ struct _MetaWaylandCompositor
|
|||||||
GHashTable *outputs;
|
GHashTable *outputs;
|
||||||
GList *frame_callback_surfaces;
|
GList *frame_callback_surfaces;
|
||||||
|
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
MetaXWaylandManager xwayland_manager;
|
MetaXWaylandManager xwayland_manager;
|
||||||
|
#endif
|
||||||
|
|
||||||
MetaWaylandSeat *seat;
|
MetaWaylandSeat *seat;
|
||||||
MetaWaylandTabletManager *tablet_manager;
|
MetaWaylandTabletManager *tablet_manager;
|
||||||
|
@ -894,6 +894,7 @@ meta_wayland_get_wayland_display_name (MetaWaylandCompositor *compositor)
|
|||||||
return compositor->display_name;
|
return compositor->display_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
const char *
|
const char *
|
||||||
meta_wayland_get_public_xwayland_display_name (MetaWaylandCompositor *compositor)
|
meta_wayland_get_public_xwayland_display_name (MetaWaylandCompositor *compositor)
|
||||||
{
|
{
|
||||||
@ -905,6 +906,7 @@ meta_wayland_get_private_xwayland_display_name (MetaWaylandCompositor *composito
|
|||||||
{
|
{
|
||||||
return compositor->xwayland_manager.private_connection.name;
|
return compositor->xwayland_manager.private_connection.name;
|
||||||
}
|
}
|
||||||
|
#endif /* HAVE_XWAYLAND */
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_wayland_compositor_restore_shortcuts (MetaWaylandCompositor *compositor,
|
meta_wayland_compositor_restore_shortcuts (MetaWaylandCompositor *compositor,
|
||||||
@ -1004,7 +1006,9 @@ meta_wayland_compositor_notify_surface_id (MetaWaylandCompositor *compositor,
|
|||||||
GINT_TO_POINTER (id));
|
GINT_TO_POINTER (id));
|
||||||
if (window)
|
if (window)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
meta_xwayland_associate_window_with_surface (window, surface);
|
meta_xwayland_associate_window_with_surface (window, surface);
|
||||||
|
#endif
|
||||||
meta_wayland_compositor_remove_surface_association (compositor, id);
|
meta_wayland_compositor_remove_surface_association (compositor, id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,10 +72,12 @@ GQueue *meta_wayland_compositor_get_committed_transactions (Meta
|
|||||||
META_EXPORT_TEST
|
META_EXPORT_TEST
|
||||||
const char *meta_wayland_get_wayland_display_name (MetaWaylandCompositor *compositor);
|
const char *meta_wayland_get_wayland_display_name (MetaWaylandCompositor *compositor);
|
||||||
|
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
META_EXPORT_TEST
|
META_EXPORT_TEST
|
||||||
const char *meta_wayland_get_public_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);
|
const char *meta_wayland_get_private_xwayland_display_name (MetaWaylandCompositor *compositor);
|
||||||
|
#endif
|
||||||
|
|
||||||
void meta_wayland_compositor_restore_shortcuts (MetaWaylandCompositor *compositor,
|
void meta_wayland_compositor_restore_shortcuts (MetaWaylandCompositor *compositor,
|
||||||
ClutterInputDevice *source);
|
ClutterInputDevice *source);
|
||||||
@ -94,8 +96,10 @@ void meta_wayland_compositor_notify_surface_id (MetaWaylandCo
|
|||||||
int id,
|
int id,
|
||||||
MetaWaylandSurface *surface);
|
MetaWaylandSurface *surface);
|
||||||
|
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
META_EXPORT_TEST
|
META_EXPORT_TEST
|
||||||
MetaXWaylandManager * meta_wayland_compositor_get_xwayland_manager (MetaWaylandCompositor *compositor);
|
MetaXWaylandManager * meta_wayland_compositor_get_xwayland_manager (MetaWaylandCompositor *compositor);
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user