From b67424b868bf9c0a81aa306ea2ed2e735dc6dfb1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Fri, 20 Jan 2012 15:39:15 +0000 Subject: [PATCH] Drain Windows message queue. To prevent window from being considered non-responsive. --- glws_wgl.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/glws_wgl.cpp b/glws_wgl.cpp index ca100d9..59f4786 100644 --- a/glws_wgl.cpp +++ b/glws_wgl.cpp @@ -162,6 +162,14 @@ public: void swapBuffers(void) { SwapBuffers(hDC); + + // Drain message queue to prevent window from being considered + // non-responsive + MSG msg; + while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { + TranslateMessage(&msg); + DispatchMessage(&msg); + } } }; -- 2.7.4