On Sat, 10 Nov 2001, Daniel Secrieru wrote:

> > For things like shaped windows you may get
> > hundreds of Expose events for a single window movement.
>     You mean I can have polygonal-shaped windows in X11? That would be
> pretty cool! :-)

    Yes, run "xeyes".  You undoubtedly have it on your system.
> 
> > If you think
> > you can really optimize it by drawing each rect separately then you
> > can handle each event.  If that's not realistic, then you should
> > throw away all events except for the zero-count event and draw
> > the whole thing when you get it.  Alternatively you can collect the
> > bounds of the nonzero-count events and draw the bounds when you
> > get to the zero-count event.
>     So, a zero-count event means that the nonzero-count events are finished
> (and whatever event generated them - moving, resizing, raising etc.), right?
> I mean that some event (moving, ...) can generate a hole string of
> nonzero-count Expose events, terminated by a zero-count Expose event. Am I
> any close to the truth?

   Yes, the count says how many are left in that batch.  It will count
down to zero.  A count of zero says that's the last rect of the batch
(zero left).

>     And if I want to redraw only the area that needs to be redrawn (not the
> entire window), all I have to do is union all those rectangles from all the
> nonzero-count Expose events, right?

  Including the final rect from the count==0 Expose event.  That's what 
you'd want to do if you wanted to handle the whole batch of rects at
once.  Alternatively you could handle them rect by rect as you get the
Expose events, but it may be more efficient for you to collect the
rects and render them all at once.  The rects passed aren't going
to overlap. 


                                MArk.


_______________________________________________
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert

Reply via email to