[at-spi2-core] Ensure that X11 symbols are only used when necessary



commit 0f3d979dc297790d8a98fab734d45751bf4fec85
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Fri Nov 18 11:03:36 2016 +0000

    Ensure that X11 symbols are only used when necessary
    
    Since at-spi2-core can be build with X11 support disabled, we need to
    ensure that we include and build the X11-specific bits only when needed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=773710

 registryd/Makefile.am             |   12 ++++++------
 registryd/deviceeventcontroller.c |   12 ++++++++----
 2 files changed, 14 insertions(+), 10 deletions(-)
---
diff --git a/registryd/Makefile.am b/registryd/Makefile.am
index c9c9d39..1ea3fd0 100644
--- a/registryd/Makefile.am
+++ b/registryd/Makefile.am
@@ -28,7 +28,7 @@ at_spi2_registryd_SOURCES =   \
        de-marshaller.h         \
        de-marshaller.c         \
        de-types.h              \
-       keymasks.h              \
+       keymasks.h              \
        paths.h                 \
        registry-main.c         \
        registry.c              \
@@ -38,15 +38,15 @@ at_spi2_registryd_SOURCES = \
        deviceeventcontroller.c \
        deviceeventcontroller.h \
        reentrant-list.c        \
-       reentrant-list.h        \
-       ucs2keysym.c
+       reentrant-list.h
 
 X11_SOURCES = \
        deviceeventcontroller-x11.c \
-       display.h               \
-       display.c               \
+       display.h \
+       display.c \
        event-source.c \
-       event-source.h
+       event-source.h \
+       ucs2keysym.c
 
 if USE_X11
 at_spi2_registryd_SOURCES += $(X11_SOURCES)
diff --git a/registryd/deviceeventcontroller.c b/registryd/deviceeventcontroller.c
index 8fefbd7..0c965ef 100644
--- a/registryd/deviceeventcontroller.c
+++ b/registryd/deviceeventcontroller.c
@@ -23,7 +23,7 @@
 
 /* deviceeventcontroller.c: implement the DeviceEventController interface */
 
-#include <config.h>
+#include "config.h"
 
 #undef  SPI_XKB_DEBUG
 #undef  SPI_DEBUG
@@ -39,11 +39,14 @@
 #include <dbus/dbus.h>
 
 #include "paths.h"
-#include "keymasks.h"
 #include "de-types.h"
 #include "de-marshaller.h"
+#include "keymasks.h"
+
+#ifdef HAVE_X11
 #include "display.h"
 #include "event-source.h"
+#endif
 
 #include "deviceeventcontroller.h"
 #include "reentrant-list.h"
@@ -64,6 +67,7 @@ struct _SpiPoint {
     gint y;
 };
 typedef struct _SpiPoint SpiPoint;
+
 static unsigned int mouse_mask_state = 0;
 static unsigned int key_modifier_mask =
   SPI_KEYMASK_MOD1 | SPI_KEYMASK_MOD2 | SPI_KEYMASK_MOD3 | SPI_KEYMASK_MOD4 |
@@ -634,7 +638,7 @@ handle_keygrab (SpiDEController         *controller,
   grab_mask.mod_mask = key_listener->mask;
   if (g_slist_length (key_listener->keys) == 0) /* special case means AnyKey/AllKeys */
     {
-      grab_mask.key_val = AnyKey;
+      grab_mask.key_val = 0L; /* AnyKey */
 #ifdef SPI_DEBUG
       fprintf (stderr, "AnyKey grab!");
 #endif
@@ -1751,7 +1755,7 @@ impl_generate_keyboard_event (DBusConnection *bus, DBusMessage *message, void *u
               * in our arg list; it can contain either
               * a keycode or a keysym.
               */
-             spi_dec_synth_keysym (controller, (KeySym) keycode);
+             spi_dec_synth_keysym (controller, keycode);
              break;
       case Accessibility_KEY_STRING:
              if (!spi_dec_plat_synth_keystring (controller, synth_type, keycode, keystring))


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