mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 21:14:35 +00:00
Wayland: Control key repeat via timerfd state
The key repeat logic is now controlled only via the key repeat timerfd.
(cherry picked from commit 850893a39f
)
This commit is contained in:
parent
5e8186af0a
commit
5f0b316c24
@ -501,12 +501,12 @@ static void keyboardHandleLeave(void* data,
|
|||||||
if (!window)
|
if (!window)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
struct itimerspec timer = {};
|
||||||
|
timerfd_settime(_glfw.wl.timerfd, 0, &timer, NULL);
|
||||||
|
|
||||||
_glfw.wl.serial = serial;
|
_glfw.wl.serial = serial;
|
||||||
_glfw.wl.keyboardFocus = NULL;
|
_glfw.wl.keyboardFocus = NULL;
|
||||||
_glfwInputWindowFocus(window, GLFW_FALSE);
|
_glfwInputWindowFocus(window, GLFW_FALSE);
|
||||||
|
|
||||||
struct itimerspec timer = {};
|
|
||||||
timerfd_settime(_glfw.wl.timerfd, 0, &timer, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int toGLFWKeyCode(uint32_t key)
|
static int toGLFWKeyCode(uint32_t key)
|
||||||
|
@ -864,8 +864,6 @@ static void handleEvents(int timeout)
|
|||||||
uint64_t repeats;
|
uint64_t repeats;
|
||||||
|
|
||||||
if (read(_glfw.wl.timerfd, &repeats, sizeof(repeats)) == 8)
|
if (read(_glfw.wl.timerfd, &repeats, sizeof(repeats)) == 8)
|
||||||
{
|
|
||||||
if (_glfw.wl.keyboardFocus)
|
|
||||||
{
|
{
|
||||||
for (uint64_t i = 0; i < repeats; i++)
|
for (uint64_t i = 0; i < repeats; i++)
|
||||||
{
|
{
|
||||||
@ -877,7 +875,6 @@ static void handleEvents(int timeout)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (fds[2].revents & POLLIN)
|
if (fds[2].revents & POLLIN)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user