Guarantees of order of X events vs requests

Owen Taylor otaylor at redhat.com
Wed Oct 20 07:25:23 PDT 2010


On Wed, 2010-10-20 at 11:34 +0200, Eirik Byrkjeflot Anonsen wrote:
> What guarantees does X give when it comes to the order of events
> generated in relation to processing of the requests sent by the client?
>
> (Also, of course: To which degree does various implementations of X
> actually fulfill these guarantees?)
> 
> 
> Some specific questions:
> 
> X events have a "serial" value.  I expect that any event delivered by X
> will reflect the state after the request number "serial" (and all
> preceding requests) have been processed.  Is this correct?

Yes.

> Can I also assume that the X event will reflect the state before any
> requests with a later serial number is processed?
>
> (And I assume that "serial" is monotonically increasing, except on
> wrap-arounds...)
> 
> 
> 
> Context:
> 
> Given an application that frequently performs a sequence of XCopyArea()
> calls on the contents of a window.  When this application receives
> Expose events or GraphicsExpose events, it is necessary for the
> application to know exactly which XCopyArea calls have taken effect to
> be able to correctly calculate which area of the window has become
> invalid.

Yes, any X application that handles scrolling correctly and efficiently
will be making these types of calculations. 

- Owen





More information about the xorg mailing list