Wayland: Control key repeat via timerfd state

The key repeat logic is now controlled only via the key repeat timerfd.
master
Camilla Löwy ago%!(EXTRA string=4 years)
parent 79e7e65c9d
commit 850893a39f
  1. 6
      src/wl_init.c
  2. 3
      src/wl_window.c

@ -504,12 +504,12 @@ static void keyboardHandleLeave(void* data,
if (!window)
return;
struct itimerspec timer = {};
timerfd_settime(_glfw.wl.timerfd, 0, &timer, NULL);
_glfw.wl.serial = serial;
_glfw.wl.keyboardFocus = NULL;
_glfwInputWindowFocus(window, GLFW_FALSE);
struct itimerspec timer = {};
timerfd_settime(_glfw.wl.timerfd, 0, &timer, NULL);
}
static int toGLFWKeyCode(uint32_t key)

@ -748,8 +748,6 @@ static void handleEvents(int timeout)
uint64_t repeats;
if (read(_glfw.wl.timerfd, &repeats, sizeof(repeats)) == 8)
{
if (_glfw.wl.keyboardFocus)
{
for (uint64_t i = 0; i < repeats; i++)
{
@ -761,7 +759,6 @@ static void handleEvents(int timeout)
}
}
}
}
if (fds[2].revents & POLLIN)
{

Loading…
Cancel
Save