
On 2008 Jun 21, at 20:47, Adam Sampson wrote:
I'm not entirely convinced it's correct, though. Is it possible for the X server to send more than one event in a single communication? If so, it would be necessary to call nextEvent to handle the subsequent events before the file descriptor becomes ready again (which'd be easy if there's a way to find out whether there are any events pending without blocking).
It is possible, and there are several ways to check (QLength(), XCheckIfEvent(), XPending(), XEventsQueued()) --- we probably want either XPending() or XEventsQueued(QueueAfterFlush) (same thing, different APIs). -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH