diff --git a/Xext/xace.c b/Xext/xace.c index d77b3126a..b3c67f632 100644 --- a/Xext/xace.c +++ b/Xext/xace.c @@ -213,6 +213,21 @@ XaceHook(int hook, ...) return prv ? *prv : Success; } +/* XaceHookIsSet + * + * Utility function to determine whether there are any callbacks listening on a + * particular XACE hook. + * + * Returns non-zero if there is a callback, zero otherwise. + */ +int +XaceHookIsSet(int hook) +{ + if (hook < 0 || hook >= XACE_NUM_HOOKS) + return 0; + return XaceHooks[hook] != NULL; +} + /* XaceCensorImage * * Called after pScreen->GetImage to prevent pieces or trusted windows from diff --git a/Xext/xace.h b/Xext/xace.h index 5e6cb0437..3303f76bc 100644 --- a/Xext/xace.h +++ b/Xext/xace.h @@ -65,6 +65,9 @@ extern _X_EXPORT int XaceHook(int /*hook */ , ... /*appropriate args for hook */ ); +/* determine whether any callbacks are present for the XACE hook */ +extern _X_EXPORT int XaceHookIsSet(int hook); + /* Special-cased hook functions */ extern _X_EXPORT int XaceHookDispatch(ClientPtr ptr, int major); diff --git a/Xi/exevents.c b/Xi/exevents.c index 1c586d051..e728310f8 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -1590,7 +1590,7 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev) if (!ti) { DebugF("[Xi] %s: Failed to get event %d for touchpoint %d\n", dev->name, type, touchid); - return; + goto out; } /* if emulate_pointer is set, emulate the motion event right @@ -1624,6 +1624,7 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev) if (ev->any.type == ET_TouchEnd) TouchEndTouch(dev, ti); + out: if (emulate_pointer) UpdateDeviceState(dev, &ev->device_event); } @@ -1730,6 +1731,18 @@ ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device) break; } + /* send KeyPress and KeyRelease events to XACE plugins */ + if (XaceHookIsSet(XACE_KEY_AVAIL) && + (event->type == ET_KeyPress || event->type == ET_KeyRelease)) { + xEvent *core; + int count; + + if (EventToCore(ev, &core, &count) == Success && count > 0) { + XaceHook(XACE_KEY_AVAIL, core, device, 0); + free(core); + } + } + if (DeviceEventCallback && !syncEvents.playingEvents) { DeviceEventInfoRec eventinfo; SpritePtr pSprite = device->spriteInfo->sprite; diff --git a/configure.ac b/configure.ac index f760730c3..f187a1357 100644 --- a/configure.ac +++ b/configure.ac @@ -2337,6 +2337,33 @@ if test "$KDRIVE" = yes; then fi fi + case $host_os in + *linux*) + KDRIVE_OS_LIB='$(top_builddir)/hw/kdrive/linux/liblinux.la' + KDRIVELINUX=yes + if test "x$KDRIVE_EVDEV" = xauto; then + KDRIVE_EVDEV=yes + fi + if test "x$KDRIVE_KBD" = xauto; then + KDRIVE_KBD=yes + fi + if test "x$KDRIVE_MOUSE" = xauto; then + KDRIVE_MOUSE=yes + fi + ;; + *) + if test "x$KDRIVE_EVDEV" = xauto; then + KDRIVE_EVDEV=no + fi + if test "x$KDRIVE_KBD" = xauto; then + KDRIVE_KBD=no + fi + if test "x$KDRIVE_MOUSE" = xauto; then + KDRIVE_MOUSE=no + fi + ;; + esac + if test "x$KDRIVE_KBD" = xyes; then AC_DEFINE(KDRIVE_KBD, 1, [Enable KDrive kbd driver]) fi @@ -2378,32 +2405,6 @@ if test "$KDRIVE" = yes; then KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $OS_LIB" KDRIVE_LIB='$(top_builddir)/hw/kdrive/src/libkdrive.la' - case $host_os in - *linux*) - KDRIVE_OS_LIB='$(top_builddir)/hw/kdrive/linux/liblinux.la' - KDRIVELINUX=yes - if test "x$KDRIVE_EVDEV" = xauto; then - KDRIVE_EVDEV=yes - fi - if test "x$KDRIVE_KBD" = xauto; then - KDRIVE_KBD=yes - fi - if test "x$KDRIVE_MOUSE" = xauto; then - KDRIVE_MOUSE=yes - fi - ;; - *) - if test "x$KDRIVE_EVDEV" = xauto; then - KDRIVE_EVDEV=no - fi - if test "x$KDRIVE_KBD" = xauto; then - KDRIVE_KBD=no - fi - if test "x$KDRIVE_MOUSE" = xauto; then - KDRIVE_MOUSE=no - fi - ;; - esac KDRIVE_MAIN_LIB="$MAIN_LIB" KDRIVE_LOCAL_LIBS="$DIX_LIB $KDRIVE_LIB" KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $FB_LIB $MI_LIB $KDRIVE_PURE_LIBS"