From 67e21e0881182eccc75eb51cf6171a72e15d6482 Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Mon, 22 Jan 2024 17:01:34 +0100 Subject: [PATCH] compositor/actor: Guard X11 actor usage Part-of: --- src/compositor/meta-window-actor.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c index d52851414..78546ffd2 100644 --- a/src/compositor/meta-window-actor.c +++ b/src/compositor/meta-window-actor.c @@ -26,13 +26,16 @@ #include "backends/meta-screen-cast-window.h" #include "compositor/compositor-private.h" #include "compositor/meta-shaped-texture-private.h" -#include "compositor/meta-surface-actor-x11.h" #include "compositor/meta-surface-actor.h" #include "compositor/meta-window-actor-private.h" #include "core/boxes-private.h" #include "core/window-private.h" #include "meta/window.h" +#ifdef HAVE_X11_CLIENT +#include "compositor/meta-surface-actor-x11.h" +#endif + #ifdef HAVE_WAYLAND #include "compositor/meta-surface-actor-wayland.h" #include "wayland/meta-wayland-surface-private.h" @@ -492,12 +495,14 @@ init_surface_actor (MetaWindowActor *self) MetaWindow *window = priv->window; MetaSurfaceActor *surface_actor = NULL; +#ifdef HAVE_X11_CLIENT if (!meta_is_wayland_compositor ()) { surface_actor = meta_surface_actor_x11_new (window); } -#ifdef HAVE_WAYLAND else +#endif +#ifdef HAVE_WAYLAND { MetaWaylandSurface *surface = meta_window_get_wayland_surface (window); surface_actor = surface ? meta_wayland_surface_get_actor (surface) : NULL; @@ -948,10 +953,11 @@ meta_window_actor_sync_actor_geometry (MetaWindowActor *self, /* When running as a Wayland compositor we catch size changes when new * buffers are attached */ +#ifdef HAVE_X11_CLIENT if (META_IS_SURFACE_ACTOR_X11 (priv->surface)) meta_surface_actor_x11_set_size (META_SURFACE_ACTOR_X11 (priv->surface), actor_rect.width, actor_rect.height); - +#endif /* Normally we want freezing a window to also freeze its position; this allows * windows to atomically move and resize together, either under app control, * or because the user is resizing from the left/top. But on initial placement