#2898·glfw

GLFW does not send key events for depressed keys on focus gain when using Wayland

Author: GeolyktCreated Sep 12, 2026Updated Sep 12, 2026

GLFW does not send key events for depressed keys on focus gain, nor does it send any events when repeating these keys and it doesn't send any events when the keys are released.

When manually intercepting the Wayland events using libwayland-client, the key repeat and and key release events are sent by the compositor as expected (depressed keys on focus gain are also sent, albeit not as sythetic key presses, but that's an unrelated implementation detail). Tested it without the libwayland-client logic and the result is the same on Wayland.

Tested on both Wayland (KDE Plasma) and X11 (KDE Plasma with glfwInitHint(GLFW.GLFW_PLATFORM, GLFW.GLFW_PLATFORM_X11) - i.e. using XWayland). On X11, the synthetic key press event, key repeat event, and release events are fired.

Text input functionality was not tested. This concerns glfwSetKeyCallback.

Key events for keys depressed after focus gain are handled properly on Wayland.