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




commit 34510bbb5cf520d782d4e018ba0232b648a78814
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 ++++
 src/x11/meta-x11-display.c      | 2 ++
 3 files changed, 12 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
diff --git a/src/x11/meta-x11-display.c b/src/x11/meta-x11-display.c
index 92827182d7..c354ca2394 100644
--- a/src/x11/meta-x11-display.c
+++ b/src/x11/meta-x11-display.c
@@ -1403,8 +1403,10 @@ meta_x11_display_new (MetaDisplay *display, GError **error)
   meta_x11_startup_notification_init (x11_display);
   meta_x11_selection_init (x11_display);
 
+#ifdef HAVE_X11
   if (!meta_is_wayland_compositor ())
     meta_dnd_init_xdnd (x11_display);
+#endif
 
   sprintf (buf, "WM_S%d", number);
 


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