From c77c8069d65214a9d78d62720c2af90f72ec322e Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Sat, 17 Jun 2006 23:46:59 +0000 Subject: [PATCH] Windows: Fix Windows sometimes marking LWJGL apps as "not responding" --- src/native/win32/org_lwjgl_opengl_Display.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/native/win32/org_lwjgl_opengl_Display.c b/src/native/win32/org_lwjgl_opengl_Display.c index 94e16940..f6c094d7 100644 --- a/src/native/win32/org_lwjgl_opengl_Display.c +++ b/src/native/win32/org_lwjgl_opengl_Display.c @@ -248,13 +248,21 @@ static void handleMessages(void) { if (display_hwnd != NULL) { while (PeekMessage( &msg, // message information - display_hwnd, // handle to window + NULL, // handle to window 0, // first message 0, // last message PM_REMOVE // removal options )) { - DispatchMessage(&msg); + /* + * It would be better to filter messages + * to display_hwnd by specifying that to + * PeekMessage instead of this check. However, + * Windows will then mark LWJGL apps as "not + * responding". + */ + if (msg.hwnd == display_hwnd) + DispatchMessage(&msg); } } }