Path: utzoo!attcan!uunet!ginosko!usc!bloom-beacon!EXPO.LCS.MIT.EDU!rws
From: rws@EXPO.LCS.MIT.EDU
Newsgroups: comp.windows.x
Subject: Re: What happens? XCopyArea done just before Expose arrives.
Message-ID: <8908172212.AA06161@expire.lcs.mit.edu>
Date: 17 Aug 89 22:12:12 GMT
References: <576@igor.Rational.COM>
Sender: daemon@bloom-beacon.MIT.EDU
Organization: The Internet
Lines: 32


    1) This *can* happen right?

Sure.

    2) Is there anything "good" that can be done about it?

Yes.

    Presumably the application could keep Regions around that describe the
    last N XCopyArea/XCopyPlanes that have been sent but for which it has
    not yet received NoExpose/GraphicsExpose events.

Right.  Note that you also have to update the regions of any outstanding copies
if they intersect a later copy.  For many applications, like those that just
scroll, this can be simplified a lot.

    It would then compare the source region for each Copy with any Expose
    regions that might come along.

No, you can use sequence numbers, which is a lot simpler.

    This seems a bit tedious and it uses memory as well as increasing
    application complexity.

Well, yes, unless somebody encapsulates it in some generic routines for reuse.
If you don't like it, you can always go synchronous, and simply wait for the
event to come back before doing any more graphics ops.

    But, as it turns out, Xterm doesn't appear to worry about this.

Haven't looked at the code recently, but it's *supposed* to worry about this.