summaryrefslogtreecommitdiff
path: root/xkb
diff options
context:
space:
mode:
authorOlivier Fourdan <ofourdan@redhat.com>2016-03-09 10:31:13 +0100
committerOlivier Fourdan <ofourdan@redhat.com>2016-06-03 09:39:42 +0200
commitfda5675f9d257d583ea0683adf863c5e1e51e30c (patch)
tree54e22d63f147e71e0e53d53b7a51da626470f8e9 /xkb
parent3735ab965a4642273d070840bda4e827991e5219 (diff)
xkb: add hook to allow/deny AccessX key repeat
The xserver generates the key repeat by itself. But when used with another server processing inputs first (e.g. a Wayland compositor), the other server may be busy dealing with some other things and not queue up key release events in time. Add a vfunc in XkbSrvInfo to possibly add a check before re-emitting a keypress event in the AccessX timer handler, so that the key repeat has a chance to be denied if the server processing the input is not ready. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'xkb')
-rw-r--r--xkb/xkbAccessX.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c
index 892cb3097..f80057747 100644
--- a/xkb/xkbAccessX.c
+++ b/xkb/xkbAccessX.c
@@ -89,6 +89,7 @@ AccessXInit(DeviceIntPtr keybd)
xkbi->repeatKeyTimer = NULL;
xkbi->krgTimer = NULL;
xkbi->beepTimer = NULL;
+ xkbi->checkRepeat = NULL;
ctrls->repeat_delay = XkbDfltRepeatDelay;
ctrls->repeat_interval = XkbDfltRepeatInterval;
ctrls->debounce_delay = 300;
@@ -317,7 +318,8 @@ AccessXRepeatKeyExpire(OsTimerPtr timer, CARD32 now, void *arg)
if (xkbi->repeatKey == 0)
return 0;
- AccessXKeyboardEvent(dev, ET_KeyPress, xkbi->repeatKey, TRUE);
+ if (xkbi->checkRepeat == NULL || xkbi->checkRepeat (dev, xkbi, xkbi->repeatKey))
+ AccessXKeyboardEvent(dev, ET_KeyPress, xkbi->repeatKey, TRUE);
return xkbi->desc->ctrls->repeat_interval;
}