summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorAndrew Eikum <aeikum@codeweavers.com>2015-06-04 13:24:53 -0500
committerPeter Hutterer <peter.hutterer@who-t.net>2015-06-10 14:14:29 +1000
commit990cf5b2828f73dc7a07f1e38f608af39acfd81d (patch)
treeb2e5aee4949d3a3764b8a223201f39eef49911cb /Xi
parent5dc2a9aae46352f1f35d3ba122da04727789a15d (diff)
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 <aeikum@codeweavers.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'Xi')
-rw-r--r--Xi/exevents.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c
index 1c586d051..cd33f94fc 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;