]> asedeno.scripts.mit.edu Git - PuTTY.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)
commit0e233b0d876765acf0b3a6d7f1dabd27b603f0d3
tree82bbcca0a9c4228ad00eb2ba225add16c9750ef5
parentab2ddd17720529ddc79c353372a5cb15713354d5
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.

[originally from svn r10052]
[r10040 == 5c4ce2fadf23bff6f38155df44b5d6040cf80d26]
windows/window.c