From 1bb6991bdac04a548505469b3fa4ed2742ca7f66 Mon Sep 17 00:00:00 2001 From: Pedro Montes Alcalde Date: Thu, 2 Nov 2023 01:20:41 +0000 Subject: [PATCH] AutoRepeat: Fix wrong repeat rate being applied When you set the auto repeat rate trough xset to something like 250 40: `xset r rate 250 40` Is setting the first delay to 250ms and set the rate to 40hz (25ms) However, if you were to apply this configuration from a xorg config file, the result would be the first delay being applied correctly, but the repeat rate would be set to 25Hz instead. This is because the config option is using a rate of repeats per second but XKB stores it as interval. Make sure this is converted correctly. Fixes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1558 Signed-off-by: EXtremeExploit --- hw/xfree86/common/xf86Xinput.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 8cf3f62f0..5b9823ed2 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -347,7 +347,7 @@ ApplyAutoRepeat(DeviceIntPtr dev) xf86Msg(X_CONFIG, "AutoRepeat: %ld %ld\n", delay, rate); xkbi->desc->ctrls->repeat_delay = delay; - xkbi->desc->ctrls->repeat_interval = rate; + xkbi->desc->ctrls->repeat_interval = 1000 / rate; } /***********************************************************************