mirror of
https://github.com/glfw/glfw.git
synced 2026-09-22 08:50:15 +00:00
X11: Fix IM-duplicated key events leaking through
Fixes #747. Fixes #964.
This commit is contained in:
+6
-7
@@ -992,17 +992,16 @@ static void processEvent(XEvent *event)
|
||||
if (window->x11.ic)
|
||||
{
|
||||
// HACK: Ignore duplicate key press events generated by ibus
|
||||
// Corresponding release events are filtered out by the
|
||||
// GLFW key repeat logic
|
||||
if (window->x11.lastKeyCode != keycode ||
|
||||
window->x11.lastKeyTime != event->xkey.time)
|
||||
// These have the same timestamp as the original event
|
||||
// Corresponding release events are filtered out
|
||||
// implicitly by the GLFW key repeat logic
|
||||
if (window->x11.lastKeyTime < event->xkey.time)
|
||||
{
|
||||
if (keycode)
|
||||
_glfwInputKey(window, key, keycode, GLFW_PRESS, mods);
|
||||
}
|
||||
|
||||
window->x11.lastKeyCode = keycode;
|
||||
window->x11.lastKeyTime = event->xkey.time;
|
||||
window->x11.lastKeyTime = event->xkey.time;
|
||||
}
|
||||
|
||||
if (!filtered)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user