From d23171754a6c4f7361ac5aed64eaa29222b32df2 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Thu, 4 Jun 2015 13:24:53 -0500 Subject: [PATCH] dix: Send KeyPress and KeyRelease events to the XACE_KEY_AVAIL hook While it's documented in the XACE spec, the XACE_KEY_AVAIL hook is currently never actually invoked by the xserver. This hook was added in 13c6713c82 (25 Aug 2006), but as the keyboard processing was moved into XKB, the hook was forgotten and silently dropped. The code calling this hook was removed by 7af53799c (4 Jan 2009), but it was probably already unused before that. This patch re-adds support for this hook. The "count" hook parameter is unused. Signed-off-by: Andrew Eikum Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer (cherry picked from commit 990cf5b2828f73dc7a07f1e38f608af39acfd81d) --- Xi/exevents.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Xi/exevents.c b/Xi/exevents.c index 0857bcee6..21fb69696 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -1730,6 +1730,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;