Re: [gtk-list] Re: GraphicsExpose (was Re: About the About Box)




Raph Levien <raph@acm.org> writes
> 
> On Wed, 17 Dec 1997, Owen Taylor wrote:
> 
> > This [ using XIfEvent to look for Graphics/NoExpose ] works and is
> > correct - though it does require the programmer to know to use
> > this recipe when appropriate.  You're approach sounds correct, and
> > might give a real performance advantage on slow networks. I
> > certainly don't have the time to implement it right now - though
> > if you (or anyone else) want to, go ahead. It would be nice to
> > have a side-by-side comparison to see if it actually makes a
> > noticeable difference.
> 
>    If it's working and correct, then I'm going to defer to you. Perhaps 
> post-1.0 we can think about optimizing the expose handling some more, but 
> for now correctness should be enough.

Unfortunately, it turns out not to completely correct - the killer
case is that a regular Expose event can occur but not be processed
when we do a XCopyArea. In that case there are regions that X thinks
are correct, but which aren't.

I'm almost convinced that there is _no_ way to handle this case
right in cases short of being highly unsocial and using XGrabServer.

It can be ameliorated however:

In my (the current scheme) one could check the queue for Expose
events before doing an XCopyArea, and dispatch them. This can't
be guaranteed to work because an expose event can happen at
any point.

In your scheme, one could apply the translation to Expose events as
well. One would have to guess whether a particular Expose event
occurred before or after a particular XCopyArea event. How to do this?
Store the serial number obtained with the NextRequest() macro before
the XCopyArea call with the information about that call, then compare
the serial number on Expose events with that.  That might even be
almost an exact solution...

But I've put my code, without trying to handle this case - I
think it is better than what was there before anyways.

Regards,
                                        Owen




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]