From 89bea58b18dd581b2464a0d1768086a0cd127fe1 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 (cherry picked from commit 509f4131bec5303b04e30617a123e7ce18a95798) --- 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 d201407a..cfac9ec6 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -140,6 +140,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 0b94356b..c2ac06c3 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,7 @@ information on what to include when reporting a bug. ## Changelog - [Win32] Fix pkg-config for dynamic library on Windows (#2386, #2420) + - [Win32] Bugfix: `glfwWaitEventsTimeout` did not return for some sent messages (#2408) - [Wayland] Added improved fallback window decorations via libdecor (#1639,#1693) - [Wayland] Bugfix: Connecting a mouse after `glfwInit` would segfault (#1450) - [Wayland] Disabled alpha channel for opaque windows on systems lacking diff --git a/src/win32_window.c b/src/win32_window.c index a2ab94d8..3c22ab16 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -2113,7 +2113,7 @@ void _glfwPlatformWaitEvents(void) void _glfwPlatformWaitEventsTimeout(double timeout) { - MsgWaitForMultipleObjects(0, NULL, FALSE, (DWORD) (timeout * 1e3), QS_ALLEVENTS); + MsgWaitForMultipleObjects(0, NULL, FALSE, (DWORD) (timeout * 1e3), QS_ALLINPUT); _glfwPlatformPollEvents(); }