mirror of
https://github.com/glfw/glfw.git
synced 2026-09-21 16:44:11 +00:00
Wayland: Clean up key repeat logic
(cherry picked from commit 9180923ea0)
This commit is contained in:
+7
-4
@@ -314,7 +314,7 @@ int _glfwPlatformInit(void)
|
||||
int cursorSize;
|
||||
|
||||
// These must be set before any failure checks
|
||||
_glfw.wl.timerfd = -1;
|
||||
_glfw.wl.keyRepeatTimerfd = -1;
|
||||
_glfw.wl.cursorTimerfd = -1;
|
||||
|
||||
_glfw.wl.cursor.handle = _glfw_dlopen("libwayland-cursor.so.0");
|
||||
@@ -435,7 +435,10 @@ int _glfwPlatformInit(void)
|
||||
|
||||
#ifdef WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION
|
||||
if (_glfw.wl.seatVersion >= WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION)
|
||||
_glfw.wl.timerfd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC | TFD_NONBLOCK);
|
||||
{
|
||||
_glfw.wl.keyRepeatTimerfd =
|
||||
timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC | TFD_NONBLOCK);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!_glfw.wl.wmBase)
|
||||
@@ -571,8 +574,8 @@ void _glfwPlatformTerminate(void)
|
||||
wl_display_disconnect(_glfw.wl.display);
|
||||
}
|
||||
|
||||
if (_glfw.wl.timerfd >= 0)
|
||||
close(_glfw.wl.timerfd);
|
||||
if (_glfw.wl.keyRepeatTimerfd >= 0)
|
||||
close(_glfw.wl.keyRepeatTimerfd);
|
||||
if (_glfw.wl.cursorTimerfd >= 0)
|
||||
close(_glfw.wl.cursorTimerfd);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user