]> asedeno.scripts.mit.edu Git - PuTTY_svn.git/commit
Avoid leaving unread Windows messages in the queue.
authorSimon Tatham <anakin@pobox.com>
Fri, 25 Oct 2013 17:44:02 +0000 (17:44 +0000)
committerSimon Tatham <anakin@pobox.com>
Fri, 25 Oct 2013 17:44:02 +0000 (17:44 +0000)
commit9413e321b9fb269b797db93c4ddf8e0c2815049c
tree82bbcca0a9c4228ad00eb2ba225add16c9750ef5
parent97e8f0802ce2055ce774b127b25a2e219ba2e01b
Avoid leaving unread Windows messages in the queue.

Jochen Erwied points out that once you've used PeekMessage to remove
_one_ message from the message queue, MsgWaitForMultipleObjects will
consider the whole queue to have been 'read', or at least looked at
and deemed uninteresting, and so it will block until a further message
comes in. Hence, my change in r10040 which stops us from looping on
PeekMessage until the queue is empty has the effect of causing the
rest of the message queue not to be acted on until a new message comes
in to unblock it. Fix by checking if the queue is nonempty in advance
of calling MsgWaitForMultipleObjects, and if so, giving it a zero
timeout just as we do if there's a pending toplevel callback.

git-svn-id: http://svn.tartarus.org/sgt/putty@10052 cda61777-01e9-0310-a592-d414129be87e
windows/window.c