From 509f4131bec5303b04e30617a123e7ce18a95798 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Wed, 15 Nov 2023 17:55:07 +0100 Subject: [PATCH] Win32: Fix glfwWaitEventsTimeout ignoring messages The bitmask passed to MsgWaitForMultipleObjects was missing QS_SENDMESSAGE, causing glfwWaitEventsTimeout not to return when the thread received messages sent from other threads. Fixes #2408 --- CONTRIBUTORS.md | 1 + README.md | 1 + src/win32_window.c | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index cba9ac73..99aab7b1 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -142,6 +142,7 @@ video tutorials. - Marcel Metz - Liam Middlebrook - Ave Milia + - Icyllis Milica - Jonathan Miller - Kenneth Miller - Bruce Mitchener diff --git a/README.md b/README.md index 5f86a9eb..2ced3ffb 100644 --- a/README.md +++ b/README.md @@ -230,6 +230,7 @@ information on what to include when reporting a bug. - [Win32] Bugfix: Instance-local operations used executable instance (#469,#1296,#1395) - [Win32] Bugfix: The OSMesa library was not unloaded on termination - [Win32] Bugfix: Right shift emitted `GLFW_KEY_UNKNOWN` when using a CJK IME (#2050) + - [Win32] Bugfix: `glfwWaitEventsTimeout` did not return for some sent messages (#2408) - [Cocoa] Added support for `VK_EXT_metal_surface` (#1619) - [Cocoa] Added locating the Vulkan loader at runtime in an application bundle - [Cocoa] Moved main menu creation to GLFW initialization time (#1649) diff --git a/src/win32_window.c b/src/win32_window.c index 676640bf..a4a18171 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -2121,7 +2121,7 @@ void _glfwWaitEventsWin32(void) void _glfwWaitEventsTimeoutWin32(double timeout) { - MsgWaitForMultipleObjects(0, NULL, FALSE, (DWORD) (timeout * 1e3), QS_ALLEVENTS); + MsgWaitForMultipleObjects(0, NULL, FALSE, (DWORD) (timeout * 1e3), QS_ALLINPUT); _glfwPollEventsWin32(); }