[mutter/bilelmoussaoui/x11-build-guards-2: 33/42] core/events: Guard X11 types




commit 98453c3bae224d09d9b91ca35e8d6a4895a9be3f
Author: Bilal Elmoussaoui <belmouss redhat com>
Date:   Wed Jun 1 10:06:55 2022 +0200

    core/events: Guard X11 types

 src/core/events.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/src/core/events.c b/src/core/events.c
index eca21f52e5..a4d4550321 100644
--- a/src/core/events.c
+++ b/src/core/events.c
@@ -27,14 +27,17 @@
 #include "backends/meta-cursor-tracker-private.h"
 #include "backends/meta-dnd-private.h"
 #include "backends/meta-idle-manager.h"
-#include "backends/x11/meta-backend-x11.h"
-#include "backends/x11/meta-input-device-x11.h"
 #include "compositor/compositor-private.h"
 #include "compositor/meta-window-actor-private.h"
 #include "core/display-private.h"
 #include "core/window-private.h"
 #include "meta/meta-backend.h"
 
+#ifdef HAVE_X11_CLIENT
+#include "backends/x11/meta-backend-x11.h"
+#include "backends/x11/meta-input-device-x11.h"
+#endif
+
 #ifdef HAVE_NATIVE_BACKEND
 #include "backends/native/meta-backend-native.h"
 #endif
@@ -178,6 +181,7 @@ sequence_is_pointer_emulated (MetaDisplay        *display,
   return FALSE;
 }
 
+#ifdef HAVE_X11_CLIENT
 static void
 maybe_unfreeze_pointer_events (MetaBackend          *backend,
                                const ClutterEvent   *event,
@@ -216,6 +220,7 @@ maybe_unfreeze_pointer_events (MetaBackend          *backend,
   xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
   XIAllowEvents (xdisplay, device_id, event_mode, event->button.time);
 }
+#endif
 
 static gboolean
 meta_display_handle_event (MetaDisplay        *display,
@@ -499,8 +504,9 @@ meta_display_handle_event (MetaDisplay        *display,
         {
           /* Only replay button press events, since that's where we
            * have the synchronous grab. */
+#ifdef HAVE_X11_CLIENT
           maybe_unfreeze_pointer_events (backend, event, EVENTS_UNFREEZE_REPLAY);
-
+#endif
           /* If the focus window has an active close dialog let clutter
            * events go through, so fancy clutter dialogs can get to handle
            * all events.
@@ -520,7 +526,9 @@ meta_display_handle_event (MetaDisplay        *display,
       /* We could not match the event with a window, make sure we sync
        * the pointer to discard the sequence and don't keep events frozen.
        */
-       maybe_unfreeze_pointer_events (backend, event, EVENTS_UNFREEZE_SYNC);
+#ifdef HAVE_X11_CLIENT
+      maybe_unfreeze_pointer_events (backend, event, EVENTS_UNFREEZE_SYNC);
+#endif
     }
 
  out:


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