Compare commits

...

3 Commits

Author SHA1 Message Date
Rémi Bernon
f24dc3c85c
Merge 54ecc8a9f5 into 768e81a0eb 2025-08-15 04:30:49 +08:00
Jan Hendrik Farr
768e81a0eb Wayland: Fix key repeat halting
Key repeat shoud only be halted when the repeating key
is released, not when another key is released.
2025-08-14 15:35:04 +02:00
Rémi Bernon
54ecc8a9f5
Explicitly unmap iconified windows before restoring them.
Closes: #2077
2025-02-17 10:55:29 +01:00
5 changed files with 15 additions and 3 deletions

View File

@ -68,6 +68,7 @@ video tutorials.
- Jan Ekström
- Siavash Eliasi
- er-azh
- Jan Hendrik Farr
- Ahmad Fatoum
- Nikita Fediuchin
- Felipe Ferreira

View File

@ -138,6 +138,7 @@ information on what to include when reporting a bug.
- [Wayland] Bugfix: Retrieved cursor position would be incorrect when hovering over
fallback decorations
- [Wayland] Bugfix: Fallback decorations would report scroll events
- [Wayland] Bugfix: Keyboard repeat events halted when any key is released (#2568)
- [X11] Bugfix: Running without a WM could trigger an assert (#2593,#2601,#2631)
- [Null] Added Vulkan 'window' surface creation via `VK_EXT_headless_surface`
- [Null] Added EGL context creation on Mesa via `EGL_MESA_platform_surfaceless`

View File

@ -1838,11 +1838,12 @@ static void keyboardHandleKey(void* userData,
timer.it_value.tv_sec = _glfw.wl.keyRepeatDelay / 1000;
timer.it_value.tv_nsec = (_glfw.wl.keyRepeatDelay % 1000) * 1000000;
timerfd_settime(_glfw.wl.keyRepeatTimerfd, 0, &timer, NULL);
}
} else if (scancode == _glfw.wl.keyRepeatScancode) {
timerfd_settime(_glfw.wl.keyRepeatTimerfd, 0, &timer, NULL);
}
timerfd_settime(_glfw.wl.keyRepeatTimerfd, 0, &timer, NULL);
_glfwInputKey(window, key, scancode, action, _glfw.wl.xkb.modifiers);
if (action == GLFW_PRESS)

View File

@ -2339,6 +2339,9 @@ void _glfwRestoreWindowX11(_GLFWwindow* window)
if (_glfwWindowIconifiedX11(window))
{
// Some window managers do not unmap iconified windows, and XMapWindow is
// then no-op. Explicitly unmap the window to make sure it gets restored.
XUnmapWindow(_glfw.x11.display, window->x11.handle);
XMapWindow(_glfw.x11.display, window->x11.handle);
waitForVisibilityNotify(window);
}

View File

@ -56,6 +56,8 @@ static void error_callback(int error, const char* description)
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
{
static GLFWwindow *iconified;
printf("%0.2f Key %s\n",
glfwGetTime(),
action == GLFW_PRESS ? "pressed" : "released");
@ -67,12 +69,15 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
{
case GLFW_KEY_I:
glfwIconifyWindow(window);
iconified = window;
break;
case GLFW_KEY_M:
glfwMaximizeWindow(window);
break;
case GLFW_KEY_R:
if (iconified) window = iconified;
glfwRestoreWindow(window);
iconified = NULL;
break;
case GLFW_KEY_ESCAPE:
glfwSetWindowShouldClose(window, GLFW_TRUE);
@ -253,9 +258,10 @@ int main(int argc, char** argv)
if (fullscreen)
monitor = glfwGetPrimaryMonitor();
window_count = 1;
window_count = 2;
windows = calloc(window_count, sizeof(GLFWwindow*));
windows[0] = create_window(monitor);
windows[1] = create_window(monitor);
}
for (i = 0; i < window_count; i++)