mirror of
https://github.com/brl/mutter.git
synced 2025-03-26 05:03:55 +00:00
build: Allow disabling xwayland
Mostly moving things around to allow a build without xwayland. Note that more work might still be needed once the x11 build option lands as that would allow us to have a proper xwayland only build without the x server part. Related: https://gitlab.gnome.org/GNOME/mutter/-/issues/2272 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2399>
This commit is contained in:
parent
7eb9797b84
commit
6e818c8c38
@ -132,7 +132,7 @@ lcms2_dep = dependency('lcms2', version: lcms2_req)
|
|||||||
have_wayland = get_option('wayland')
|
have_wayland = get_option('wayland')
|
||||||
# For now always require X11 support
|
# For now always require X11 support
|
||||||
have_x11 = true
|
have_x11 = true
|
||||||
have_xwayland = have_wayland # for now default to have_wayland
|
have_xwayland = get_option('xwayland')
|
||||||
have_x11_client = have_x11 or have_xwayland
|
have_x11_client = have_x11 or have_xwayland
|
||||||
|
|
||||||
if have_xwayland and not have_wayland
|
if have_xwayland and not have_wayland
|
||||||
|
@ -39,6 +39,12 @@ option('wayland',
|
|||||||
description: 'Enable Wayland support'
|
description: 'Enable Wayland support'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
option('xwayland',
|
||||||
|
type: 'boolean',
|
||||||
|
value: true,
|
||||||
|
description: 'Enable Xwayland support'
|
||||||
|
)
|
||||||
|
|
||||||
option('systemd',
|
option('systemd',
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
value: true,
|
value: true,
|
||||||
|
@ -81,9 +81,17 @@
|
|||||||
#ifdef HAVE_WAYLAND
|
#ifdef HAVE_WAYLAND
|
||||||
#include "compositor/meta-compositor-native.h"
|
#include "compositor/meta-compositor-native.h"
|
||||||
#include "compositor/meta-compositor-server.h"
|
#include "compositor/meta-compositor-server.h"
|
||||||
#include "wayland/meta-xwayland-private.h"
|
#include "wayland/meta-wayland.h"
|
||||||
|
#include "wayland/meta-wayland-input-device.h"
|
||||||
|
#include "wayland/meta-wayland-private.h"
|
||||||
#include "wayland/meta-wayland-tablet-seat.h"
|
#include "wayland/meta-wayland-tablet-seat.h"
|
||||||
#include "wayland/meta-wayland-tablet-pad.h"
|
#include "wayland/meta-wayland-tablet-pad.h"
|
||||||
|
#include "wayland/meta-wayland-tablet-manager.h"
|
||||||
|
#include "wayland/meta-wayland-touch.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
|
#include "wayland/meta-xwayland-private.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_NATIVE_BACKEND
|
#ifdef HAVE_NATIVE_BACKEND
|
||||||
@ -770,6 +778,7 @@ meta_display_init_x11_finish (MetaDisplay *display,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
static void
|
static void
|
||||||
on_xserver_started (MetaXWaylandManager *manager,
|
on_xserver_started (MetaXWaylandManager *manager,
|
||||||
GAsyncResult *result,
|
GAsyncResult *result,
|
||||||
@ -798,6 +807,7 @@ on_xserver_started (MetaXWaylandManager *manager,
|
|||||||
g_task_return_boolean (task, TRUE);
|
g_task_return_boolean (task, TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* HAVE_XWAYLAND */
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_display_init_x11 (MetaDisplay *display,
|
meta_display_init_x11 (MetaDisplay *display,
|
||||||
@ -805,17 +815,22 @@ meta_display_init_x11 (MetaDisplay *display,
|
|||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
MetaWaylandCompositor *compositor = wayland_compositor_from_display (display);
|
|
||||||
|
|
||||||
g_autoptr (GTask) task = NULL;
|
g_autoptr (GTask) task = NULL;
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
|
MetaWaylandCompositor *compositor;
|
||||||
|
#endif
|
||||||
|
|
||||||
task = g_task_new (display, cancellable, callback, user_data);
|
task = g_task_new (display, cancellable, callback, user_data);
|
||||||
g_task_set_source_tag (task, meta_display_init_x11);
|
g_task_set_source_tag (task, meta_display_init_x11);
|
||||||
|
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
|
compositor = wayland_compositor_from_display (display);
|
||||||
|
|
||||||
meta_xwayland_start_xserver (&compositor->xwayland_manager,
|
meta_xwayland_start_xserver (&compositor->xwayland_manager,
|
||||||
cancellable,
|
cancellable,
|
||||||
(GAsyncReadyCallback) on_xserver_started,
|
(GAsyncReadyCallback) on_xserver_started,
|
||||||
g_steal_pointer (&task));
|
g_steal_pointer (&task));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -94,6 +94,9 @@
|
|||||||
#include "wayland/meta-wayland-private.h"
|
#include "wayland/meta-wayland-private.h"
|
||||||
#include "wayland/meta-wayland-surface.h"
|
#include "wayland/meta-wayland-surface.h"
|
||||||
#include "wayland/meta-window-wayland.h"
|
#include "wayland/meta-window-wayland.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
#include "wayland/meta-window-xwayland.h"
|
#include "wayland/meta-window-xwayland.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -31,7 +31,10 @@
|
|||||||
#include "wayland/meta-wayland-buffer.h"
|
#include "wayland/meta-wayland-buffer.h"
|
||||||
#include "wayland/meta-wayland-surface.h"
|
#include "wayland/meta-wayland-surface.h"
|
||||||
#include "wayland/meta-window-wayland.h"
|
#include "wayland/meta-window-wayland.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
#include "wayland/meta-xwayland-surface.h"
|
#include "wayland/meta-xwayland-surface.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct _MetaWaylandActorSurfacePrivate MetaWaylandActorSurfacePrivate;
|
typedef struct _MetaWaylandActorSurfacePrivate MetaWaylandActorSurfacePrivate;
|
||||||
|
|
||||||
@ -225,6 +228,7 @@ meta_wayland_actor_surface_real_sync_actor_state (MetaWaylandActorSurface *actor
|
|||||||
meta_surface_actor_set_input_region (surface_actor, NULL);
|
meta_surface_actor_set_input_region (surface_actor, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
if (!META_IS_XWAYLAND_SURFACE (surface_role))
|
if (!META_IS_XWAYLAND_SURFACE (surface_role))
|
||||||
{
|
{
|
||||||
if (!meta_shaped_texture_has_alpha (stex))
|
if (!meta_shaped_texture_has_alpha (stex))
|
||||||
@ -249,6 +253,7 @@ meta_wayland_actor_surface_real_sync_actor_state (MetaWaylandActorSurface *actor
|
|||||||
meta_surface_actor_set_opaque_region (surface_actor, NULL);
|
meta_surface_actor_set_opaque_region (surface_actor, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
meta_shaped_texture_set_transform (stex, surface->buffer_transform);
|
meta_shaped_texture_set_transform (stex, surface->buffer_transform);
|
||||||
|
|
||||||
|
@ -31,7 +31,10 @@
|
|||||||
#include "wayland/meta-wayland-buffer.h"
|
#include "wayland/meta-wayland-buffer.h"
|
||||||
#include "wayland/meta-wayland-presentation-time-private.h"
|
#include "wayland/meta-wayland-presentation-time-private.h"
|
||||||
#include "wayland/meta-wayland-private.h"
|
#include "wayland/meta-wayland-private.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
#include "wayland/meta-xwayland.h"
|
#include "wayland/meta-xwayland.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct _MetaWaylandCursorSurfacePrivate MetaWaylandCursorSurfacePrivate;
|
typedef struct _MetaWaylandCursorSurfacePrivate MetaWaylandCursorSurfacePrivate;
|
||||||
|
|
||||||
@ -89,6 +92,7 @@ cursor_sprite_prepare_at (MetaCursorSprite *cursor_sprite,
|
|||||||
MetaWaylandSurfaceRole *role = META_WAYLAND_SURFACE_ROLE (cursor_surface);
|
MetaWaylandSurfaceRole *role = META_WAYLAND_SURFACE_ROLE (cursor_surface);
|
||||||
MetaWaylandSurface *surface = meta_wayland_surface_role_get_surface (role);
|
MetaWaylandSurface *surface = meta_wayland_surface_role_get_surface (role);
|
||||||
|
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
if (!meta_xwayland_is_xwayland_surface (surface))
|
if (!meta_xwayland_is_xwayland_surface (surface))
|
||||||
{
|
{
|
||||||
MetaWaylandSurfaceRole *surface_role =
|
MetaWaylandSurfaceRole *surface_role =
|
||||||
@ -119,6 +123,8 @@ cursor_sprite_prepare_at (MetaCursorSprite *cursor_sprite,
|
|||||||
surface->buffer_transform);
|
surface->buffer_transform);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
meta_wayland_surface_update_outputs (surface);
|
meta_wayland_surface_update_outputs (surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,10 @@
|
|||||||
#include "wayland/meta-wayland-seat.h"
|
#include "wayland/meta-wayland-seat.h"
|
||||||
#include "wayland/meta-wayland-subsurface.h"
|
#include "wayland/meta-wayland-subsurface.h"
|
||||||
#include "wayland/meta-wayland-surface.h"
|
#include "wayland/meta-wayland-surface.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
#include "wayland/meta-xwayland.h"
|
#include "wayland/meta-xwayland.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "pointer-constraints-unstable-v1-server-protocol.h"
|
#include "pointer-constraints-unstable-v1-server-protocol.h"
|
||||||
|
|
||||||
@ -158,6 +161,7 @@ connect_window (MetaWaylandSurfacePointerConstraintsData *data,
|
|||||||
G_CALLBACK (window_raised), NULL);
|
G_CALLBACK (window_raised), NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
static void
|
static void
|
||||||
window_associated (MetaWaylandSurfaceRole *surface_role,
|
window_associated (MetaWaylandSurfaceRole *surface_role,
|
||||||
MetaWaylandSurfacePointerConstraintsData *data)
|
MetaWaylandSurfacePointerConstraintsData *data)
|
||||||
@ -171,6 +175,7 @@ window_associated (MetaWaylandSurfaceRole *surface_role,
|
|||||||
|
|
||||||
meta_wayland_pointer_constraint_maybe_enable_for_window (window);
|
meta_wayland_pointer_constraint_maybe_enable_for_window (window);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static MetaWaylandSurfacePointerConstraintsData *
|
static MetaWaylandSurfacePointerConstraintsData *
|
||||||
surface_constraint_data_new (MetaWaylandSurface *surface)
|
surface_constraint_data_new (MetaWaylandSurface *surface)
|
||||||
@ -187,6 +192,7 @@ surface_constraint_data_new (MetaWaylandSurface *surface)
|
|||||||
{
|
{
|
||||||
connect_window (data, window);
|
connect_window (data, window);
|
||||||
}
|
}
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
else if (meta_xwayland_is_xwayland_surface (surface))
|
else if (meta_xwayland_is_xwayland_surface (surface))
|
||||||
{
|
{
|
||||||
data->window_associated_handler_id =
|
data->window_associated_handler_id =
|
||||||
@ -194,6 +200,7 @@ surface_constraint_data_new (MetaWaylandSurface *surface)
|
|||||||
G_CALLBACK (window_associated),
|
G_CALLBACK (window_associated),
|
||||||
data);
|
data);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g_warn_if_reached ();
|
g_warn_if_reached ();
|
||||||
@ -459,6 +466,7 @@ should_constraint_be_enabled (MetaWaylandPointerConstraint *constraint)
|
|||||||
MetaWindow *window;
|
MetaWindow *window;
|
||||||
|
|
||||||
window = meta_wayland_surface_get_window (constraint->surface);
|
window = meta_wayland_surface_get_window (constraint->surface);
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
if (!window)
|
if (!window)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@ -470,6 +478,7 @@ should_constraint_be_enabled (MetaWaylandPointerConstraint *constraint)
|
|||||||
META_IS_WAYLAND_SUBSURFACE (constraint->surface->role));
|
META_IS_WAYLAND_SUBSURFACE (constraint->surface->role));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (window->unmanaging)
|
if (window->unmanaging)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -477,6 +486,7 @@ should_constraint_be_enabled (MetaWaylandPointerConstraint *constraint)
|
|||||||
if (constraint->seat->pointer->focus_surface != constraint->surface)
|
if (constraint->seat->pointer->focus_surface != constraint->surface)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
if (meta_xwayland_is_xwayland_surface (constraint->surface))
|
if (meta_xwayland_is_xwayland_surface (constraint->surface))
|
||||||
{
|
{
|
||||||
MetaDisplay *display = meta_window_get_display (window);
|
MetaDisplay *display = meta_window_get_display (window);
|
||||||
@ -499,11 +509,10 @@ should_constraint_be_enabled (MetaWaylandPointerConstraint *constraint)
|
|||||||
display->focus_window->client_type != META_WINDOW_CLIENT_TYPE_X11)
|
display->focus_window->client_type != META_WINDOW_CLIENT_TYPE_X11)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
else
|
#endif
|
||||||
{
|
|
||||||
if (!meta_window_appears_focused (window))
|
if (!meta_window_appears_focused (window))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -621,7 +630,9 @@ meta_wayland_pointer_constraint_calculate_effective_region (MetaWaylandPointerCo
|
|||||||
MetaFrame *frame = window->frame;
|
MetaFrame *frame = window->frame;
|
||||||
int actual_width, actual_height;
|
int actual_width, actual_height;
|
||||||
|
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
g_assert (meta_xwayland_is_xwayland_surface (constraint->surface));
|
g_assert (meta_xwayland_is_xwayland_surface (constraint->surface));
|
||||||
|
#endif
|
||||||
|
|
||||||
actual_width = window->buffer_rect.width - (frame->child_x +
|
actual_width = window->buffer_rect.width - (frame->child_x +
|
||||||
frame->right_width);
|
frame->right_width);
|
||||||
|
@ -62,7 +62,10 @@
|
|||||||
#include "wayland/meta-wayland-private.h"
|
#include "wayland/meta-wayland-private.h"
|
||||||
#include "wayland/meta-wayland-seat.h"
|
#include "wayland/meta-wayland-seat.h"
|
||||||
#include "wayland/meta-wayland-surface.h"
|
#include "wayland/meta-wayland-surface.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
#include "wayland/meta-xwayland.h"
|
#include "wayland/meta-xwayland.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_NATIVE_BACKEND
|
#ifdef HAVE_NATIVE_BACKEND
|
||||||
#include "backends/native/meta-backend-native.h"
|
#include "backends/native/meta-backend-native.h"
|
||||||
|
@ -52,8 +52,10 @@
|
|||||||
#include "wayland/meta-wayland-viewporter.h"
|
#include "wayland/meta-wayland-viewporter.h"
|
||||||
#include "wayland/meta-wayland-xdg-shell.h"
|
#include "wayland/meta-wayland-xdg-shell.h"
|
||||||
#include "wayland/meta-window-wayland.h"
|
#include "wayland/meta-window-wayland.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
#include "wayland/meta-xwayland-private.h"
|
#include "wayland/meta-xwayland-private.h"
|
||||||
#include "wayland/meta-xwayland-private.h"
|
#endif
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
@ -1533,7 +1535,9 @@ meta_wayland_surface_create (MetaWaylandCompositor *compositor,
|
|||||||
|
|
||||||
wl_list_init (&surface->presentation_time.feedback_list);
|
wl_list_init (&surface->presentation_time.feedback_list);
|
||||||
|
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
meta_wayland_compositor_notify_surface_id (compositor, id, surface);
|
meta_wayland_compositor_notify_surface_id (compositor, id, surface);
|
||||||
|
#endif
|
||||||
|
|
||||||
return surface;
|
return surface;
|
||||||
}
|
}
|
||||||
|
@ -50,9 +50,12 @@
|
|||||||
#include "wayland/meta-wayland-tablet-manager.h"
|
#include "wayland/meta-wayland-tablet-manager.h"
|
||||||
#include "wayland/meta-wayland-transaction.h"
|
#include "wayland/meta-wayland-transaction.h"
|
||||||
#include "wayland/meta-wayland-xdg-foreign.h"
|
#include "wayland/meta-wayland-xdg-foreign.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
#include "wayland/meta-xwayland-grab-keyboard.h"
|
#include "wayland/meta-xwayland-grab-keyboard.h"
|
||||||
#include "wayland/meta-xwayland-private.h"
|
#include "wayland/meta-xwayland-private.h"
|
||||||
#include "wayland/meta-xwayland.h"
|
#include "wayland/meta-xwayland.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_NATIVE_BACKEND
|
#ifdef HAVE_NATIVE_BACKEND
|
||||||
#include "backends/native/meta-renderer-native.h"
|
#include "backends/native/meta-renderer-native.h"
|
||||||
@ -409,7 +412,9 @@ void
|
|||||||
meta_wayland_compositor_init_display (MetaWaylandCompositor *compositor,
|
meta_wayland_compositor_init_display (MetaWaylandCompositor *compositor,
|
||||||
MetaDisplay *display)
|
MetaDisplay *display)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
meta_xwayland_init_display (&compositor->xwayland_manager, display);
|
meta_xwayland_init_display (&compositor->xwayland_manager, display);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void meta_wayland_log_func (const char *, va_list) G_GNUC_PRINTF (1, 0);
|
static void meta_wayland_log_func (const char *, va_list) G_GNUC_PRINTF (1, 0);
|
||||||
@ -426,12 +431,14 @@ meta_wayland_log_func (const char *fmt,
|
|||||||
void
|
void
|
||||||
meta_wayland_compositor_prepare_shutdown (MetaWaylandCompositor *compositor)
|
meta_wayland_compositor_prepare_shutdown (MetaWaylandCompositor *compositor)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
MetaX11DisplayPolicy x11_display_policy;
|
MetaX11DisplayPolicy x11_display_policy;
|
||||||
|
|
||||||
x11_display_policy =
|
x11_display_policy =
|
||||||
meta_context_get_x11_display_policy (compositor->context);
|
meta_context_get_x11_display_policy (compositor->context);
|
||||||
if (x11_display_policy != META_X11_DISPLAY_POLICY_DISABLED)
|
if (x11_display_policy != META_X11_DISPLAY_POLICY_DISABLED)
|
||||||
meta_xwayland_shutdown (&compositor->xwayland_manager);
|
meta_xwayland_shutdown (&compositor->xwayland_manager);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (compositor->wayland_display)
|
if (compositor->wayland_display)
|
||||||
wl_display_destroy_clients (compositor->wayland_display);
|
wl_display_destroy_clients (compositor->wayland_display);
|
||||||
@ -487,6 +494,7 @@ meta_wayland_compositor_class_init (MetaWaylandCompositorClass *klass)
|
|||||||
object_class->finalize = meta_wayland_compositor_finalize;
|
object_class->finalize = meta_wayland_compositor_finalize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
static bool
|
static bool
|
||||||
meta_xwayland_global_filter (const struct wl_client *client,
|
meta_xwayland_global_filter (const struct wl_client *client,
|
||||||
const struct wl_global *global,
|
const struct wl_global *global,
|
||||||
@ -503,6 +511,7 @@ meta_xwayland_global_filter (const struct wl_client *client,
|
|||||||
/* All others are visible to all clients */
|
/* All others are visible to all clients */
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_wayland_override_display_name (const char *display_name)
|
meta_wayland_override_display_name (const char *display_name)
|
||||||
@ -635,11 +644,13 @@ meta_wayland_compositor_new (MetaContext *context)
|
|||||||
meta_wayland_activation_init (compositor);
|
meta_wayland_activation_init (compositor);
|
||||||
meta_wayland_transaction_init (compositor);
|
meta_wayland_transaction_init (compositor);
|
||||||
|
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
/* Xwayland specific protocol, needs to be filtered out for all other clients */
|
/* Xwayland specific protocol, needs to be filtered out for all other clients */
|
||||||
if (meta_xwayland_grab_keyboard_init (compositor))
|
if (meta_xwayland_grab_keyboard_init (compositor))
|
||||||
wl_display_set_global_filter (compositor->wayland_display,
|
wl_display_set_global_filter (compositor->wayland_display,
|
||||||
meta_xwayland_global_filter,
|
meta_xwayland_global_filter,
|
||||||
compositor);
|
compositor);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_WAYLAND_EGLSTREAM
|
#ifdef HAVE_WAYLAND_EGLSTREAM
|
||||||
{
|
{
|
||||||
@ -664,6 +675,7 @@ meta_wayland_compositor_new (MetaContext *context)
|
|||||||
|
|
||||||
x11_display_policy =
|
x11_display_policy =
|
||||||
meta_context_get_x11_display_policy (compositor->context);
|
meta_context_get_x11_display_policy (compositor->context);
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
if (x11_display_policy != META_X11_DISPLAY_POLICY_DISABLED)
|
if (x11_display_policy != META_X11_DISPLAY_POLICY_DISABLED)
|
||||||
{
|
{
|
||||||
g_autoptr (GError) error = NULL;
|
g_autoptr (GError) error = NULL;
|
||||||
@ -674,6 +686,7 @@ meta_wayland_compositor_new (MetaContext *context)
|
|||||||
&error))
|
&error))
|
||||||
g_error ("Failed to start X Wayland: %s", error->message);
|
g_error ("Failed to start X Wayland: %s", error->message);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (_display_name_override)
|
if (_display_name_override)
|
||||||
{
|
{
|
||||||
@ -812,6 +825,7 @@ meta_wayland_compositor_schedule_surface_association (MetaWaylandCompositor *com
|
|||||||
GINT_TO_POINTER (id), window);
|
GINT_TO_POINTER (id), window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
void
|
void
|
||||||
meta_wayland_compositor_notify_surface_id (MetaWaylandCompositor *compositor,
|
meta_wayland_compositor_notify_surface_id (MetaWaylandCompositor *compositor,
|
||||||
int id,
|
int id,
|
||||||
@ -827,6 +841,7 @@ meta_wayland_compositor_notify_surface_id (MetaWaylandCompositor *compositor,
|
|||||||
meta_wayland_compositor_remove_surface_association (compositor, id);
|
meta_wayland_compositor_remove_surface_association (compositor, id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
meta_wayland_compositor_is_egl_display_bound (MetaWaylandCompositor *compositor)
|
meta_wayland_compositor_is_egl_display_bound (MetaWaylandCompositor *compositor)
|
||||||
@ -837,22 +852,16 @@ meta_wayland_compositor_is_egl_display_bound (MetaWaylandCompositor *compositor)
|
|||||||
return priv->is_wayland_egl_display_bound;
|
return priv->is_wayland_egl_display_bound;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
MetaXWaylandManager *
|
MetaXWaylandManager *
|
||||||
meta_wayland_compositor_get_xwayland_manager (MetaWaylandCompositor *compositor)
|
meta_wayland_compositor_get_xwayland_manager (MetaWaylandCompositor *compositor)
|
||||||
{
|
{
|
||||||
return &compositor->xwayland_manager;
|
return &compositor->xwayland_manager;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
MetaContext *
|
MetaContext *
|
||||||
meta_wayland_compositor_get_context (MetaWaylandCompositor *compositor)
|
meta_wayland_compositor_get_context (MetaWaylandCompositor *compositor)
|
||||||
{
|
{
|
||||||
return compositor->context;
|
return compositor->context;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
|
||||||
meta_wayland_compositor_handle_xwayland_xevent (MetaWaylandCompositor *compositor,
|
|
||||||
XEvent *xevent)
|
|
||||||
{
|
|
||||||
return meta_xwayland_manager_handle_xevent (&compositor->xwayland_manager,
|
|
||||||
xevent);
|
|
||||||
}
|
|
||||||
|
@ -89,6 +89,7 @@ void meta_wayland_compositor_schedule_surface_association (Me
|
|||||||
int id,
|
int id,
|
||||||
MetaWindow *window);
|
MetaWindow *window);
|
||||||
|
|
||||||
|
#ifdef HAVE_XWAYLAND
|
||||||
void meta_wayland_compositor_notify_surface_id (MetaWaylandCompositor *compositor,
|
void meta_wayland_compositor_notify_surface_id (MetaWaylandCompositor *compositor,
|
||||||
int id,
|
int id,
|
||||||
MetaWaylandSurface *surface);
|
MetaWaylandSurface *surface);
|
||||||
@ -96,10 +97,10 @@ void meta_wayland_compositor_notify_surface_id (MetaWaylandCo
|
|||||||
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
|
||||||
|
|
||||||
META_EXPORT_TEST
|
META_EXPORT_TEST
|
||||||
MetaContext * meta_wayland_compositor_get_context (MetaWaylandCompositor *compositor);
|
MetaContext * meta_wayland_compositor_get_context (MetaWaylandCompositor *compositor);
|
||||||
|
|
||||||
gboolean meta_wayland_compositor_handle_xwayland_xevent (MetaWaylandCompositor *compositor,
|
|
||||||
XEvent *event);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -51,6 +51,7 @@
|
|||||||
#include "meta/main.h"
|
#include "meta/main.h"
|
||||||
#include "meta/meta-backend.h"
|
#include "meta/meta-backend.h"
|
||||||
#include "meta/meta-x11-errors.h"
|
#include "meta/meta-x11-errors.h"
|
||||||
|
#include "wayland/meta-xwayland-grab-keyboard.h"
|
||||||
#include "wayland/meta-xwayland-surface.h"
|
#include "wayland/meta-xwayland-surface.h"
|
||||||
#include "x11/meta-x11-display-private.h"
|
#include "x11/meta-x11-display-private.h"
|
||||||
|
|
||||||
@ -71,6 +72,7 @@ static void meta_xwayland_stop_xserver (MetaXWaylandManager *manager);
|
|||||||
static void
|
static void
|
||||||
meta_xwayland_set_primary_output (MetaX11Display *x11_display);
|
meta_xwayland_set_primary_output (MetaX11Display *x11_display);
|
||||||
|
|
||||||
|
|
||||||
static MetaMonitorManager *
|
static MetaMonitorManager *
|
||||||
monitor_manager_from_x11_display (MetaX11Display *x11_display)
|
monitor_manager_from_x11_display (MetaX11Display *x11_display)
|
||||||
{
|
{
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
#include "x11/window-x11-private.h"
|
#include "x11/window-x11-private.h"
|
||||||
#include "x11/xprops.h"
|
#include "x11/xprops.h"
|
||||||
|
|
||||||
#ifdef HAVE_WAYLAND
|
#ifdef HAVE_XWAYLAND
|
||||||
#include "wayland/meta-wayland-private.h"
|
#include "wayland/meta-wayland-private.h"
|
||||||
#include "wayland/meta-xwayland-private.h"
|
#include "wayland/meta-xwayland-private.h"
|
||||||
#include "wayland/meta-xwayland.h"
|
#include "wayland/meta-xwayland.h"
|
||||||
@ -1659,7 +1659,7 @@ handle_other_xevent (MetaX11Display *x11_display,
|
|||||||
case ClientMessage:
|
case ClientMessage:
|
||||||
if (window)
|
if (window)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_WAYLAND
|
#ifdef HAVE_XWAYLAND
|
||||||
if (event->xclient.message_type == x11_display->atom_WL_SURFACE_ID)
|
if (event->xclient.message_type == x11_display->atom_WL_SURFACE_ID)
|
||||||
{
|
{
|
||||||
guint32 surface_id = event->xclient.data.l[0];
|
guint32 surface_id = event->xclient.data.l[0];
|
||||||
@ -1889,7 +1889,7 @@ meta_x11_display_handle_xevent (MetaX11Display *x11_display,
|
|||||||
gboolean bypass_compositor = FALSE, bypass_gtk = FALSE;
|
gboolean bypass_compositor = FALSE, bypass_gtk = FALSE;
|
||||||
XIEvent *input_event;
|
XIEvent *input_event;
|
||||||
MetaCursorTracker *cursor_tracker;
|
MetaCursorTracker *cursor_tracker;
|
||||||
#ifdef HAVE_WAYLAND
|
#ifdef HAVE_XWAYLAND
|
||||||
MetaWaylandCompositor *wayland_compositor;
|
MetaWaylandCompositor *wayland_compositor;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1906,10 +1906,12 @@ meta_x11_display_handle_xevent (MetaX11Display *x11_display,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_WAYLAND
|
#ifdef HAVE_XWAYLAND
|
||||||
wayland_compositor = meta_context_get_wayland_compositor (context);
|
wayland_compositor = meta_context_get_wayland_compositor (context);
|
||||||
if (wayland_compositor &&
|
|
||||||
meta_wayland_compositor_handle_xwayland_xevent (wayland_compositor, event))
|
if (meta_is_wayland_compositor () &&
|
||||||
|
meta_xwayland_manager_handle_xevent (&wayland_compositor->xwayland_manager,
|
||||||
|
event))
|
||||||
{
|
{
|
||||||
bypass_gtk = bypass_compositor = TRUE;
|
bypass_gtk = bypass_compositor = TRUE;
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -69,7 +69,7 @@
|
|||||||
#include "x11/window-props.h"
|
#include "x11/window-props.h"
|
||||||
#include "x11/xprops.h"
|
#include "x11/xprops.h"
|
||||||
|
|
||||||
#ifdef HAVE_WAYLAND
|
#ifdef HAVE_XWAYLAND
|
||||||
#include "wayland/meta-xwayland-private.h"
|
#include "wayland/meta-xwayland-private.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1010,7 +1010,7 @@ set_work_area_hint (MetaDisplay *display,
|
|||||||
static const char *
|
static const char *
|
||||||
get_display_name (MetaDisplay *display)
|
get_display_name (MetaDisplay *display)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_WAYLAND
|
#ifdef HAVE_XWAYLAND
|
||||||
MetaContext *context = meta_display_get_context (display);
|
MetaContext *context = meta_display_get_context (display);
|
||||||
MetaWaylandCompositor *compositor =
|
MetaWaylandCompositor *compositor =
|
||||||
meta_context_get_wayland_compositor (context);
|
meta_context_get_wayland_compositor (context);
|
||||||
@ -1223,7 +1223,7 @@ meta_x11_display_new (MetaDisplay *display,
|
|||||||
|
|
||||||
XSynchronize (xdisplay, meta_context_is_x11_sync (context));
|
XSynchronize (xdisplay, meta_context_is_x11_sync (context));
|
||||||
|
|
||||||
#ifdef HAVE_WAYLAND
|
#ifdef HAVE_XWAYLAND
|
||||||
if (meta_is_wayland_compositor ())
|
if (meta_is_wayland_compositor ())
|
||||||
{
|
{
|
||||||
MetaWaylandCompositor *compositor =
|
MetaWaylandCompositor *compositor =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user