From 959fde8f992372805c855f7f4caf30a690bdc137 Mon Sep 17 00:00:00 2001 From: Patryk Kaczmarek Date: Thu, 23 Apr 2015 19:46:22 +0200 Subject: [PATCH] Some conditions added to build also on wayland Change-Id: Iae18df02994af3db06d333339f087a183efcdde2 Signed-off-by: Patryk Kaczmarek --- configure.ac | 4 ++-- packaging/at-spi2-core.spec | 8 +++++--- registryd/deviceeventcontroller.c | 16 ++++++++++++++++ registryd/keymasks.h | 3 +++ registryd/ucs2keysym.c | 3 ++- 5 files changed, 28 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index e90411a..ebbeb3f 100644 --- a/configure.ac +++ b/configure.ac @@ -91,7 +91,7 @@ save_LIBS="$LIBS" LIBS="" CPPFLAGS="$CPPFLAGS $X_CFLAGS" AC_CHECK_LIB(Xtst, XTestFakeKeyEvent, XTST_LIBS=-lXtst,[ - AC_MSG_ERROR([Couldn't find the Xtst library. Check config.log])], + AC_MSG_WARN([Couldn't find the Xtst library. Check config.log])], $X_LIBS) AC_SUBST(XTST_LIBS) LIBS="$LIBS $save_LIBS" @@ -117,7 +117,7 @@ if test "x$have_xinput" = "xmaybe"; then LIBS="$save_LIBS" fi if test "x$have_xinput" != "xyes"; then - AC_MSG_ERROR([Couldn't find the XInput library. Check config.log for details]) + AC_MSG_WARN([Couldn't find the XInput library. Check config.log for details]) fi XINPUT_LIBS="-lXi" AC_SUBST(XINPUT_LIBS) diff --git a/packaging/at-spi2-core.spec b/packaging/at-spi2-core.spec index a88d987..e8808ea 100644 --- a/packaging/at-spi2-core.spec +++ b/packaging/at-spi2-core.spec @@ -18,12 +18,11 @@ BuildRequires: dbus-devel BuildRequires: glib2-devel BuildRequires: gettext BuildRequires: gtk-doc -%if !%{with x} -ExclusiveArch: -%endif +%if %{with x} BuildRequires: libX11-devel BuildRequires: libXtst-devel BuildRequires: libXi-devel +%endif %description AT-SPI is a general interface for applications to make use of the @@ -70,6 +69,9 @@ cp %{SOURCE1001} . %build %autogen --libexecdir=%{_libexecdir}/at-spi2 \ --with-dbus-daemondir=%{_bindir} \ +%if !%{with x} + --disable-x11 \ +%endif --disable-static %__make %{?_smp_flags} diff --git a/registryd/deviceeventcontroller.c b/registryd/deviceeventcontroller.c index 8279a1d..62cd706 100644 --- a/registryd/deviceeventcontroller.c +++ b/registryd/deviceeventcontroller.c @@ -42,8 +42,10 @@ #include "keymasks.h" #include "de-types.h" #include "de-marshaller.h" +#ifdef HAVE_X11 #include "display.h" #include "event-source.h" +#endif #include "deviceeventcontroller.h" #include "reentrant-list.h" @@ -65,9 +67,14 @@ struct _SpiPoint { }; typedef struct _SpiPoint SpiPoint; static unsigned int mouse_mask_state = 0; +#ifdef HAVE_X11 static unsigned int key_modifier_mask = Mod1Mask | Mod2Mask | Mod3Mask | Mod4Mask | Mod5Mask | ShiftMask | LockMask | ControlMask | SPI_KEYMASK_NUMLOCK; static unsigned int _numlock_physical_mask = Mod2Mask; /* a guess, will be reset */ +#else +static unsigned int key_modifier_mask = 255; +static unsigned int _numlock_physical_mask = (1<<4); +#endif static gboolean have_mouse_listener = FALSE; static gboolean have_mouse_event_listener = FALSE; @@ -632,7 +639,12 @@ handle_keygrab (SpiDEController *controller, grab_mask.mod_mask = key_listener->mask; if (g_slist_length (key_listener->keys) == 0) /* special case means AnyKey/AllKeys */ { +#ifdef HAVE_X11 grab_mask.key_val = AnyKey; +#else + grab_mask.key_val = 0L; +#endif + #ifdef SPI_DEBUG fprintf (stderr, "AnyKey grab!"); #endif @@ -1749,7 +1761,11 @@ impl_generate_keyboard_event (DBusConnection *bus, DBusMessage *message, void *u * in our arg list; it can contain either * a keycode or a keysym. */ +#ifdef HAVE_X11 spi_dec_synth_keysym (controller, (KeySym) keycode); +#else + spi_dec_synth_keysym (controller, (long) keycode); +#endif break; case Accessibility_KEY_STRING: if (!spi_dec_plat_synth_keystring (controller, synth_type, keycode, keystring)) diff --git a/registryd/keymasks.h b/registryd/keymasks.h index 6dc95ad..8000448 100644 --- a/registryd/keymasks.h +++ b/registryd/keymasks.h @@ -24,7 +24,10 @@ #ifndef SPI_KEYMASKS_H_ #define SPI_KEYMASKS_H_ + +#ifdef HAVE_X11 #include +#endif #include G_BEGIN_DECLS diff --git a/registryd/ucs2keysym.c b/registryd/ucs2keysym.c index b4967be..539685c 100644 --- a/registryd/ucs2keysym.c +++ b/registryd/ucs2keysym.c @@ -30,8 +30,9 @@ * This software is in the public domain. Share and enjoy! * */ - +#ifdef HAVE_X11 #include +#endif #include "deviceeventcontroller.h" /* for prototype */ struct codepair { -- 2.7.4