Skip to content

Commit

Permalink
Wayland: Fix text input not following key repeat
Browse files Browse the repository at this point in the history
The manual key repeat implementation did not call text input.
  • Loading branch information
elmindreda committed Dec 31, 2021
1 parent bf99587 commit 1a7da42
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ information on what to include when reporting a bug.
- [Wayland] Bugfix: Showing a hidden window did not emit a window refresh event
- [Wayland] Bugfix: Full screen window creation did not ignore `GLFW_VISIBLE`
- [Wayland] Bugfix: Some keys were reported as wrong key or `GLFW_KEY_UNKNOWN`
- [Wayland] Bugfix: Text input did not repeat along with key repeat
- [POSIX] Removed use of deprecated function `gettimeofday`
- [POSIX] Bugfix: `CLOCK_MONOTONIC` was not correctly tested for or enabled
- [WGL] Disabled the DWM swap interval hack for Windows 8 and later (#1072)
Expand Down
4 changes: 2 additions & 2 deletions src/wl_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ static xkb_keysym_t composeSymbol(xkb_keysym_t sym)
}
}

static GLFWbool inputChar(_GLFWwindow* window, uint32_t scancode)
GLFWbool _glfwInputTextWayland(_GLFWwindow* window, uint32_t scancode)
{
const xkb_keysym_t* keysyms;
const xkb_keycode_t keycode = scancode + 8;
Expand Down Expand Up @@ -577,7 +577,7 @@ static void keyboardHandleKey(void* data,

if (action == GLFW_PRESS)
{
const GLFWbool shouldRepeat = inputChar(window, scancode);
const GLFWbool shouldRepeat = _glfwInputTextWayland(window, scancode);

if (shouldRepeat && _glfw.wl.keyboardRepeatRate > 0)
{
Expand Down
1 change: 1 addition & 0 deletions src/wl_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -495,4 +495,5 @@ GLFWbool _glfwGetGammaRampWayland(_GLFWmonitor* monitor, GLFWgammaramp* ramp);
void _glfwSetGammaRampWayland(_GLFWmonitor* monitor, const GLFWgammaramp* ramp);

void _glfwAddOutputWayland(uint32_t name, uint32_t version);
GLFWbool _glfwInputTextWayland(_GLFWwindow* window, uint32_t scancode);

2 changes: 2 additions & 0 deletions src/wl_window.c
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,8 @@ static void handleEvents(int timeout)
_glfw.wl.keyboardLastScancode,
GLFW_PRESS,
_glfw.wl.xkb.modifiers);
_glfwInputTextWayland(_glfw.wl.keyboardFocus,
_glfw.wl.keyboardLastScancode);
}
}
}
Expand Down

0 comments on commit 1a7da42

Please sign in to comment.