Add glfwGetKeyboardRepeatDelay() to the GLFW API for X11, Wayland and Cocoa

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/4765810b-ecf5-4348-ae3a-ff0ff481aaae
This commit is contained in:
copilot-swe-agent[bot]
2026-03-23 11:46:35 +00:00
parent 23b5e44ce5
commit 998ee22ecb
10 changed files with 43 additions and 0 deletions

12
glfw/x11_window.c vendored
View File

@@ -2876,6 +2876,18 @@ monotonic_t _glfwPlatformGetDoubleClickInterval(_GLFWwindow* window UNUSED)
return ms_to_monotonic_t(500ll);
}
monotonic_t _glfwPlatformGetKeyboardRepeatDelay(void)
{
monotonic_t delay = ms_to_monotonic_t(500ll);
XkbDescPtr xkb = XkbAllocKeyboard();
if (xkb) {
if (XkbGetControls(_glfw.x11.display, XkbRepeatKeysMask, xkb) == Success)
delay = ms_to_monotonic_t(xkb->ctrls->repeat_delay);
XkbFreeKeyboard(xkb, 0, True);
}
return delay;
}
void _glfwPlatformIconifyWindow(_GLFWwindow* window)
{
XIconifyWindow(_glfw.x11.display, window->x11.handle, _glfw.x11.screen);