mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-23 10:54:33 +00:00
Changed Run() to give priority to system messages over application messages
This commit is contained in:
parent
6a276ed201
commit
b09c6bfe4e
@ -42,18 +42,34 @@ nsNativeViewerApp::Run()
|
||||
OpenWindow();
|
||||
|
||||
// Process messages
|
||||
MSG msg;
|
||||
while (::GetMessage(&msg, NULL, 0, 0)) {
|
||||
if (!JSConsole::sAccelTable ||
|
||||
!gConsole ||
|
||||
!gConsole->GetMainWindow() ||
|
||||
!TranslateAccelerator(gConsole->GetMainWindow(),
|
||||
JSConsole::sAccelTable, &msg)) {
|
||||
MSG msg;
|
||||
int keepGoing = 1;
|
||||
|
||||
// Pump all messages
|
||||
do {
|
||||
BOOL havePriorityMessage;
|
||||
|
||||
// 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)) {
|
||||
keepGoing = (msg.message != WM_QUIT);
|
||||
|
||||
} else {
|
||||
// Block and wait for any posted application message
|
||||
keepGoing = ::GetMessage(&msg, NULL, 0, 0);
|
||||
}
|
||||
|
||||
// If we successfully retrieved a message then dispatch it
|
||||
if (keepGoing >= 0) {
|
||||
if (!JSConsole::sAccelTable || !gConsole || !gConsole->GetMainWindow() ||
|
||||
!TranslateAccelerator(gConsole->GetMainWindow(), JSConsole::sAccelTable, &msg)) {
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
} while (keepGoing != 0);
|
||||
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
return msg.wParam;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user