A couple of users report that my recent reworking of the Windows
top-level message loop has led to messages occasionally being lost,
and MsgWaitForMultipleObjects blocking when it ought to have been
called with a zero timeout. I haven't been able to reproduce this
myself, but according to one reporter, PeekMessage(PM_NOREMOVE) is
effective at checking for a non-empty message queue in a way that
GetQueueStatus is not. Switch to using that instead. Thanks to Eric
Flumerfelt for debugging and testing help.
git-svn-id: http://svn.tartarus.org/sgt/putty@10057
cda61777-01e9-0310-a592-
d414129be87e
int nhandles, n;
DWORD timeout;
- if (toplevel_callback_pending() || GetQueueStatus(QS_ALLINPUT)) {
+ if (toplevel_callback_pending() ||
+ PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) {
/*
* If we have anything we'd like to do immediately, set
* the timeout for MsgWaitForMultipleObjects to zero so