From cc028c9c2e9d838dcf4e86e7fd4ad09c4dd2ee47 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Wed, 22 Feb 2006 10:47:14 +0000 Subject: [PATCH] Win32: Made the message processing more friendly to potential foreign windows created on the same thread (and thus sharing message queue with LWJGL). Now handleMessages() in Display.c only processes messages for the current lwjgl window. --- src/native/win32/org_lwjgl_opengl_Display.c | 26 ++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/native/win32/org_lwjgl_opengl_Display.c b/src/native/win32/org_lwjgl_opengl_Display.c index 18aefb84..94e16940 100644 --- a/src/native/win32/org_lwjgl_opengl_Display.c +++ b/src/native/win32/org_lwjgl_opengl_Display.c @@ -238,25 +238,25 @@ static LRESULT CALLBACK lwjglWindowProc(HWND hWnd, /* * Handle native Win32 messages */ -static void handleMessages(void) -{ +static void handleMessages(void) { /* * Now's our chance to deal with Windows messages that are * otherwise just piling up and causing everything not to * work properly */ MSG msg; - while (PeekMessage( - &msg, // message information - NULL, // handle to window - 0, // first message - 0, // last message - PM_REMOVE // removal options - )) - { - if (display_hwnd != NULL && msg.hwnd == display_hwnd) - DispatchMessage(&msg); - }; + if (display_hwnd != NULL) { + while (PeekMessage( + &msg, // message information + display_hwnd, // handle to window + 0, // first message + 0, // last message + PM_REMOVE // removal options + )) + { + DispatchMessage(&msg); + } + } } /*