[mutter/bilelmoussaoui/x11-build-guards-2: 40/42] compositor/actor: Guard X11 types




commit 024532fa0542da8bafc7a13fd9f813d9deec5cc1
Author: Bilal Elmoussaoui <belmouss redhat com>
Date:   Fri Jun 17 11:05:10 2022 +0200

    compositor/actor: Guard X11 types

 src/compositor/meta-window-actor.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
index 9fd9f758c6..6f949458d3 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -29,13 +29,16 @@
 #include "compositor/compositor-private.h"
 #include "compositor/meta-cullable.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.h"
@@ -389,16 +392,16 @@ init_surface_actor (MetaWindowActor *self)
   MetaWindowActorPrivate *priv =
     meta_window_actor_get_instance_private (self);
   MetaWindow *window = priv->window;
-  MetaSurfaceActor *surface_actor;
+  MetaSurfaceActor *surface_actor = NULL;
 
+#ifdef HAVE_X11_CLIENT
   if (!meta_is_wayland_compositor ())
     surface_actor = meta_surface_actor_x11_new (window);
+#endif
 #ifdef HAVE_WAYLAND
-  else if (window->surface)
+  if (window->surface)
     surface_actor = meta_wayland_surface_get_actor (window->surface);
 #endif
-  else
-    surface_actor = NULL;
 
   if (surface_actor)
     meta_window_actor_assign_surface_actor (self, surface_actor);
@@ -851,10 +854,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),
                                      window_rect.width, window_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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]