Xlib: unexpected async reply (sequence 0x7)

Matthias Käppler m.kaeppler at googlemail.com
Thu Nov 15 08:49:04 PST 2007

Hi Glynn,

2007/11/15, Glynn Clements <glynn at gclements.plus.com>:
> Sorry, I misread the code. If you aren't interested in a specific
> window, use XCheckTypedEvent() instead. If you need to allow other
> parts of the code to see the event, you can use XPutBackEvent() to
> return the event to the queue.

Yes I stumbled across this function meanwhile. However, using this function
results in an active wait condition, because that function does not block.
I'd rather not run into 100% CPU load just to process some X events ;-)

However, I found that XMaskEvent does exactly what I need in terms of event
processing; instead of having to actively wait, it will put the calling
thread to sleep until some event matching the given mask arrives in the

BUT, to get back on topic: As to the "unexpected async reply" errors. With
the risk of ridiculing myself, I "fixed" the problem by simply opening the
same display again using XOpenDisplay(NULL) in the event thread. Using the
Display pointer returned by that call (which is then specific to that
thread), I no more receive these errors.

I guess this however is not the way it is intended to use? I mean, I call
the same function with the same argument (XOpenDisplay(NULL)) in both
threads now, and use the respective Display structure instances only within
the boundaries of their "parent" threads. While this does the job, will this
have any other side effects?

Best regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg/attachments/20071115/9c232bbf/attachment.html>

More information about the xorg mailing list