Wayland: Fix text input not following key repeat

The manual key repeat implementation did not call text input.

(cherry picked from commit 1a7da42e6e)
This commit is contained in:
Camilla Löwy 2021-12-30 21:09:23 +01:00
parent 6b15731e6c
commit e155c19f8e
4 changed files with 6 additions and 2 deletions

View File

@ -133,6 +133,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: Showing a hidden window did not emit a window refresh event
- [Wayland] Bugfix: Full screen window creation did not ignore `GLFW_VISIBLE` - [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: Some keys were reported as wrong key or `GLFW_KEY_UNKNOWN`
- [Wayland] Bugfix: Text input did not repeat along with key repeat
## Contact ## Contact

View File

@ -531,7 +531,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_keysym_t* keysyms;
const xkb_keycode_t keycode = scancode + 8; const xkb_keycode_t keycode = scancode + 8;
@ -573,7 +573,7 @@ static void keyboardHandleKey(void* data,
if (action == GLFW_PRESS) if (action == GLFW_PRESS)
{ {
const GLFWbool shouldRepeat = inputChar(window, scancode); const GLFWbool shouldRepeat = _glfwInputTextWayland(window, scancode);
if (shouldRepeat && _glfw.wl.keyboardRepeatRate > 0) if (shouldRepeat && _glfw.wl.keyboardRepeatRate > 0)
{ {

View File

@ -350,4 +350,5 @@ typedef struct _GLFWcursorWayland
void _glfwAddOutputWayland(uint32_t name, uint32_t version); void _glfwAddOutputWayland(uint32_t name, uint32_t version);
GLFWbool _glfwInputTextWayland(_GLFWwindow* window, uint32_t scancode);

View File

@ -883,6 +883,8 @@ static void handleEvents(int timeout)
_glfw.wl.keyboardLastScancode, _glfw.wl.keyboardLastScancode,
GLFW_PRESS, GLFW_PRESS,
_glfw.wl.xkb.modifiers); _glfw.wl.xkb.modifiers);
_glfwInputTextWayland(_glfw.wl.keyboardFocus,
_glfw.wl.keyboardLastScancode);
} }
} }
} }