From eac0eb7881bec12eb970cf5d84370bfbe3d253b0 Mon Sep 17 00:00:00 2001 From: "kmcclusk%netscape.com" Date: Mon, 22 Nov 1999 22:51:39 +0000 Subject: [PATCH] Applied patch for improving event dispatching on WIN32. bug=17881. r=rods@netscape.com,michael.lowe@bigfoot.com git-svn-id: svn://10.0.0.236/trunk@54195 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/widget/src/windows/nsAppShell.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/mozilla/widget/src/windows/nsAppShell.cpp b/mozilla/widget/src/windows/nsAppShell.cpp index 39b05276716..2ad7a09987f 100644 --- a/mozilla/widget/src/windows/nsAppShell.cpp +++ b/mozilla/widget/src/windows/nsAppShell.cpp @@ -78,20 +78,22 @@ NS_METHOD nsAppShell::Run(void) // Give priority to system messages (in particular keyboard, mouse, // timer, and paint messages). // Note: on Win98 and NT 5.0 we can also use PM_QS_INPUT and PM_QS_PAINT flags. - if (::PeekMessage(&msg, NULL, 0, WM_USER-1, PM_REMOVE)) { + if (::PeekMessage(&msg, NULL, 0, WM_USER-1, PM_REMOVE) || + ::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { + keepGoing = (msg.message != WM_QUIT); - + + if (keepGoing != 0) { + TranslateMessage(&msg); + DispatchMessage(&msg); + if (mDispatchListener) + mDispatchListener->AfterDispatch(); + } } else { - // Block and wait for any posted application message - keepGoing = ::GetMessage(&msg, NULL, 0, 0); + // Block and wait for any posted application message + ::WaitMessage(); } - if (keepGoing != 0) { - TranslateMessage(&msg); - DispatchMessage(&msg); - if (mDispatchListener) - mDispatchListener->AfterDispatch(); - } } while (keepGoing != 0); Release(); return msg.wParam;