[mutter/bilelmoussaoui/x11-build-guards] compositor/dnd: Guard X11 types



commit 5fe725ff7ff2b97d5501e64e6f993498838815e7
Author: Bilal Elmoussaoui <belmouss redhat com>
Date:   Wed Jun 1 09:39:01 2022 +0200

    compositor/dnd: Guard X11 types

 src/backends/meta-dnd-private.h | 7 ++++++-
 src/compositor/meta-dnd.c       | 4 ++++
 2 files changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/src/backends/meta-dnd-private.h b/src/backends/meta-dnd-private.h
index a4cb372207..856b88942e 100644
--- a/src/backends/meta-dnd-private.h
+++ b/src/backends/meta-dnd-private.h
@@ -21,17 +21,22 @@
 #define META_DND_PRIVATE__H
 
 #include <glib.h>
+
+#ifdef HAVE_X11
 #include <X11/Xlib.h>
+#include "compositor/meta-compositor-x11.h"
+#endif
 
 #include "backends/meta-backend-private.h"
-#include "compositor/meta-compositor-x11.h"
 
+#ifdef HAVE_X11
 gboolean meta_dnd_handle_xdnd_event (MetaBackend       *backend,
                                      MetaCompositorX11 *compositor_x11,
                                      Display           *xdisplay,
                                      XEvent            *xev);
 
 void meta_dnd_init_xdnd (MetaX11Display *x11_display);
+#endif
 
 #ifdef HAVE_WAYLAND
 void meta_dnd_wayland_handle_begin_modal (MetaCompositor *compositor);
diff --git a/src/compositor/meta-dnd.c b/src/compositor/meta-dnd.c
index 4053ccaeaf..7dd7d9db97 100644
--- a/src/compositor/meta-dnd.c
+++ b/src/compositor/meta-dnd.c
@@ -108,6 +108,7 @@ meta_dnd_init (MetaDnd *dnd)
 {
 }
 
+#ifdef HAVE_X11
 void
 meta_dnd_init_xdnd (MetaX11Display *x11_display)
 {
@@ -136,6 +137,7 @@ meta_dnd_init_xdnd (MetaX11Display *x11_display)
                    XInternAtom (xdisplay, "XdndProxy", TRUE), XA_WINDOW,
                    32, PropModeReplace, (const unsigned char *) &xwindow, 1);
 }
+#endif
 
 static void
 meta_dnd_notify_dnd_enter (MetaDnd *dnd)
@@ -165,6 +167,7 @@ meta_dnd_notify_dnd_leave (MetaDnd *dnd)
  *
  * http://www.freedesktop.org/wiki/Specifications/XDND
  */
+#ifdef HAVE_X11
 gboolean
 meta_dnd_handle_xdnd_event (MetaBackend       *backend,
                             MetaCompositorX11 *compositor_x11,
@@ -224,6 +227,7 @@ meta_dnd_handle_xdnd_event (MetaBackend       *backend,
 
   return FALSE;
 }
+#endif
 
 #ifdef HAVE_WAYLAND
 static void


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