From 7420814fe20346d8e8b074ede9d77bc5546bb5fe Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Tue, 25 Oct 2016 21:25:04 +0200 Subject: [PATCH] Win32: Poll only helper window messages at init --- src/win32_init.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/win32_init.c b/src/win32_init.c index 4c0979da..5c4e9b62 100644 --- a/src/win32_init.c +++ b/src/win32_init.c @@ -304,6 +304,7 @@ static void createKeyTables(void) // static HWND createHelperWindow(void) { + MSG msg; HWND window = CreateWindowExW(WS_EX_OVERLAPPEDWINDOW, _GLFW_WNDCLASSNAME, L"GLFW helper window", @@ -336,6 +337,12 @@ static HWND createHelperWindow(void) DEVICE_NOTIFY_WINDOW_HANDLE); } + while (PeekMessageW(&msg, _glfw.win32.helperWindowHandle, 0, 0, PM_REMOVE)) + { + TranslateMessage(&msg); + DispatchMessageW(&msg); + } + return window; } @@ -423,8 +430,6 @@ int _glfwPlatformInit(void) if (!_glfw.win32.helperWindowHandle) return GLFW_FALSE; - _glfwPlatformPollEvents(); - _glfwInitTimerWin32(); _glfwInitJoysticksWin32();