Update glfw from upstream

This commit is contained in:
Kovid Goyal 2018-03-28 19:57:01 +05:30
parent bfa53d4b45
commit 9ba2c4b397
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 2 additions and 5 deletions

1
glfw/wl_init.c vendored
View File

@ -484,7 +484,6 @@ static void keyboardHandleKey(void* data,
{ {
_glfw.wl.keyRepeatInfo.glfwKeyCode = keyCode; _glfw.wl.keyRepeatInfo.glfwKeyCode = keyCode;
_glfw.wl.keyRepeatInfo.scancode = key; _glfw.wl.keyRepeatInfo.scancode = key;
_glfw.wl.keyRepeatInfo.isFirstRepeat = GLFW_TRUE;
_glfw.wl.keyRepeatInfo.nextRepeatAt = glfwGetTime() + (double)(_glfw.wl.keyboardRepeatDelay) / 1000.0; _glfw.wl.keyRepeatInfo.nextRepeatAt = glfwGetTime() + (double)(_glfw.wl.keyboardRepeatDelay) / 1000.0;
_glfw.wl.keyRepeatInfo.keyboardFocus = window; _glfw.wl.keyRepeatInfo.keyboardFocus = window;
} }

1
glfw/wl_platform.h vendored
View File

@ -208,7 +208,6 @@ typedef struct _GLFWlibraryWayland
int plain; int plain;
int glfwKeyCode; int glfwKeyCode;
int scancode; int scancode;
GLFWbool isFirstRepeat;
double nextRepeatAt; double nextRepeatAt;
_GLFWwindow* keyboardFocus; _GLFWwindow* keyboardFocus;
} keyRepeatInfo; } keyRepeatInfo;

5
glfw/wl_window.c vendored
View File

@ -693,13 +693,12 @@ static void
dispatchPendingKeyRepeats() { dispatchPendingKeyRepeats() {
if (_glfw.wl.keyRepeatInfo.nextRepeatAt <= 0 || _glfw.wl.keyRepeatInfo.keyboardFocus != _glfw.wl.keyboardFocus || _glfw.wl.keyboardRepeatRate == 0) return; if (_glfw.wl.keyRepeatInfo.nextRepeatAt <= 0 || _glfw.wl.keyRepeatInfo.keyboardFocus != _glfw.wl.keyboardFocus || _glfw.wl.keyboardRepeatRate == 0) return;
double now = glfwGetTime(); double now = glfwGetTime();
const int mods = _glfw.wl.xkb.modifiers;
while (_glfw.wl.keyRepeatInfo.nextRepeatAt <= now) { while (_glfw.wl.keyRepeatInfo.nextRepeatAt <= now) {
const int mods = _glfw.wl.xkb.modifiers;
_glfwInputKey(_glfw.wl.keyRepeatInfo.keyboardFocus, _glfw.wl.keyRepeatInfo.glfwKeyCode, _glfw.wl.keyRepeatInfo.scancode, GLFW_REPEAT, mods); _glfwInputKey(_glfw.wl.keyRepeatInfo.keyboardFocus, _glfw.wl.keyRepeatInfo.glfwKeyCode, _glfw.wl.keyRepeatInfo.scancode, GLFW_REPEAT, mods);
if (_glfw.wl.keyRepeatInfo.codepoint > -1) _glfwInputChar(_glfw.wl.keyRepeatInfo.keyboardFocus, _glfw.wl.keyRepeatInfo.codepoint, mods, _glfw.wl.keyRepeatInfo.plain); if (_glfw.wl.keyRepeatInfo.codepoint > -1) _glfwInputChar(_glfw.wl.keyRepeatInfo.keyboardFocus, _glfw.wl.keyRepeatInfo.codepoint, mods, _glfw.wl.keyRepeatInfo.plain);
_glfw.wl.keyRepeatInfo.nextRepeatAt += 1.0 / _glfw.wl.keyboardRepeatRate;
now = glfwGetTime(); now = glfwGetTime();
_glfw.wl.keyRepeatInfo.nextRepeatAt = now + (1.0 / _glfw.wl.keyboardRepeatRate);
_glfw.wl.keyRepeatInfo.isFirstRepeat = GLFW_FALSE;
} }
} }