Wayland: keyboard repeat rate is given in Hz

It was currently interpreted as ms, which is obviously wrong.

Thanks to https://github.com/Smithay/client-toolkit/pull/62 for making
me notice this issue.
This commit is contained in:
Emmanuel Gil Peyrot 2019-02-20 15:56:04 +01:00
parent ec3784f3d7
commit 5f9cbd0ebc

View File

@ -589,8 +589,10 @@ static void keyboardHandleKey(void* data,
{ {
_glfw.wl.keyboardLastKey = keyCode; _glfw.wl.keyboardLastKey = keyCode;
_glfw.wl.keyboardLastScancode = key; _glfw.wl.keyboardLastScancode = key;
timer.it_interval.tv_sec = _glfw.wl.keyboardRepeatRate / 1000; if (_glfw.wl.keyboardRepeatRate > 1)
timer.it_interval.tv_nsec = (_glfw.wl.keyboardRepeatRate % 1000) * 1000000; timer.it_interval.tv_nsec = 1000000000 / _glfw.wl.keyboardRepeatRate;
else
timer.it_interval.tv_sec = 1;
timer.it_value.tv_sec = _glfw.wl.keyboardRepeatDelay / 1000; timer.it_value.tv_sec = _glfw.wl.keyboardRepeatDelay / 1000;
timer.it_value.tv_nsec = (_glfw.wl.keyboardRepeatDelay % 1000) * 1000000; timer.it_value.tv_nsec = (_glfw.wl.keyboardRepeatDelay % 1000) * 1000000;
} }