diff --git a/legacy/ecore/configure.ac b/legacy/ecore/configure.ac index fc2e4c55ac..d9abf296f2 100644 --- a/legacy/ecore/configure.ac +++ b/legacy/ecore/configure.ac @@ -435,6 +435,40 @@ if ! test "x$have_ecore_x_xcb" = "xyes" ; then AC_SUBST(Xcursor_cflags) AC_SUBST(Xcursor_libs) + Xkb_libs="" + Xkb_cflags="" + use_Xkb="no" + PCFLAGS=$CFLAGS + CFLAGS="$x_cflags $x_includes" + AC_CHECK_HEADER(X11/XKBlib.h, + [ + AC_CHECK_LIB(X11, XkbSetDetectableAutoRepeat, + [ + AC_DEFINE(ECORE_XKB, 1, [Build support for Xkb]) + Xkb_cflags="" + Xkb_libs="" + use_Xkb="yes" + ], [ + Xkb_cflags="" + Xkb_libs="" + use_Xkb="no" + ], [ + $x_libs + ] + ) + ], [ + Xkb_cflags="" + Xkb_libs="" + use_Xkb="no" + ], [ + #include + ] + ) + CFLAGS=$PCFLAGS + + AC_SUBST(Xkb_cflags) + AC_SUBST(Xkb_libs) + ECORE_CHECK_X_EXTENSION([Xcomposite], [Xcomposite.h], [Xcomposite], [XCompositeQueryExtension]) ECORE_CHECK_X_EXTENSION([Xdamage], [Xdamage.h], [Xdamage], [XDamageSubtract]) ECORE_CHECK_X_EXTENSION([Xdpms], [dpms.h], [Xdpms], [DPMSQueryExtension]) @@ -1027,6 +1061,7 @@ if test "x$have_ecore_x" = "xyes" ; then else echo " Ecore_X (Xlib backend).......: $have_ecore_x" echo " Xcursor....................: $use_Xcursor" + echo " Xkb........................: $use_Xkb" echo " Xprint.....................: $use_xprint" echo " Xinerama...................: $use_xinerama" echo " Xrandr.....................: $use_xrandr" diff --git a/legacy/ecore/src/lib/ecore_x/xlib/Makefile.am b/legacy/ecore/src/lib/ecore_x/xlib/Makefile.am index 4ebb57d7f9..db4c8faf04 100644 --- a/legacy/ecore/src/lib/ecore_x/xlib/Makefile.am +++ b/legacy/ecore/src/lib/ecore_x/xlib/Makefile.am @@ -5,6 +5,7 @@ if BUILD_ECORE_X_XLIB AM_CPPFLAGS = \ @Xcursor_cflags@ \ +@Xkb_cflags@ \ @XDAMAGE_CFLAGS@ \ @XCOMPOSITE_CFLAGS@ \ @XDPMS_CFLAGS@ \ @@ -56,6 +57,7 @@ ecore_x_atoms.c libecore_x_xlib_la_LIBADD = \ @Xcursor_libs@ \ +@Xkb_libs@ \ @XDAMAGE_LIBS@ \ @XCOMPOSITE_LIBS@ \ @XDPMS_LIBS@ \ diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x.c index ab4c58eab3..a10df817a0 100644 --- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x.c +++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x.c @@ -279,7 +279,19 @@ ecore_x_init(const char *name) if (_ecore_x_event_damage_id) _ecore_x_event_handlers[_ecore_x_event_damage_id] = _ecore_x_event_handle_damage_notify; #endif - +#ifdef ECORE_XKB + // set x autorepeat detection to on. that means instead of + // press-release-press-release-press-release + // you get + // press-press-press-press-press-release + do + { + Bool works = 0; + XkbSetDetectableAutoRepeat(_ecore_x_disp, 1, &works); + } + while (0); +#endif + if (!ECORE_X_EVENT_KEY_DOWN) { ECORE_X_EVENT_KEY_DOWN = ecore_event_type_new(); diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_private.h b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_private.h index e2f99709b7..72142e1277 100644 --- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_private.h +++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_private.h @@ -47,6 +47,9 @@ #ifdef ECORE_XDPMS #include #endif +#ifdef ECORE_XKB +#include +#endif #include "ecore_private.h" #include "Ecore_X.h"