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.

This commit is contained in:
Elias Naur 2006-02-22 10:47:14 +00:00
parent 2bc1b89772
commit cc028c9c2e

View file

@ -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);
}
}
}
/*