On Fri, 9 Nov 2001, Daniel Secrieru wrote: > >The question is: can I > > process them one by one? Why should I take all the Expose events and union > > all the rects together, as Greg said? I can hardly believe that someone > > might succed in exposing 2 rectangles of a a window at the same time (i.e. > > moving to windows that overlap another, so that the last will have 2 rect > to > > redraw)... > Sorry about that. It's pretty clear that by moving only one window over > another, at least 2 rectangles must be redrawn. I wil rephrase the question: > Is an Expose event generated for every rectangle that needs to be redrawn? > Or when an Expose event is generated, it can contain a list of rectangles > that need to be redrawn?
An Expose event is sent for each rectangle, though it is essentially just walking through a list of rects and sending you the exposures one-by-one. You can tell when that is happening by the count field in the Expose event. For things like shaped windows you may get hundreds of Expose events for a single window movement. 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. Mark. _______________________________________________ Xpert mailing list [EMAIL PROTECTED] http://XFree86.Org/mailman/listinfo/xpert