[comp.windows.x] How do I avoid a flood of Expose events?

geoff@veritas.uucp (Geoffrey Leach) (08/25/90)

I could use some advice on the following situation.  Environment is X11R3.

I have a widget that sits beneath a bunch of other widgets.  Even though
I elect event compression, building the stack results in a flood of
expose events for the widget on the bottom, with resultant redundant
re-drawing.  How can I detect or avoid them?

west@gsrc.enet.dec.com (Jim West (Stealth Contractor)) (08/27/90)

In article <1990Aug25.002403.1804@veritas.uucp>, 
geoff@veritas.uucp (Geoffrey Leach) writes...

>I could use some advice on the following situation.  Environment is X11R3.
> 
>I have a widget that sits beneath a bunch of other widgets.  Even though
>I elect event compression, building the stack results in a flood of
>expose events for the widget on the bottom, with resultant redundant
>re-drawing.  How can I detect or avoid them?

  Is this a widget that you are writing/wrote or just using ?  In either
case when you receive the event you can check to see what kind of event
it is.

  If it is an expose event then the event structure will contain an
element that holds the value of how many more expose events are to
follow for that series.

  If you just using widgets then only do an XtDispatchEvent on the last
expose event.

  If you are getting several independent series of expose events then
you could do something like, just hold the latest one and after some
period of time dispatch it.

  Granted, things like this are band-aids/kludges but do work in the
case you mentioned.

----------------------------------------------------------------------
 Jim West                      |  The Schainker Converse
 west@gsrc.enet.dec.com        |  to Hoare's Law :
                               |
 These are my opinions.        |   Inside every small problem
 Digital has no idea           |     is a larger problem struggling
 what I'm  saying.             |       to get out.
----------------------------------------------------------------------

razdan@phx.mcd.mot.com (anshuman razdan) (08/28/90)

In article <1990Aug25.002403.1804@veritas.uucp> geoff@veritas.uucp (Geoffrey Leach) writes:

   Path: mcdphx!asuvax!cs.utexas.edu!usc!snorkelwacker!apple!veritas!geoff
   From: geoff@veritas.uucp (Geoffrey Leach)
   Newsgroups: comp.windows.x
   Date: 25 Aug 90 00:24:03 GMT
   Organization: VERITAS Software
   Lines: 6

   I could use some advice on the following situation.  Environment is X11R3.

   I have a widget that sits beneath a bunch of other widgets.  Even though
   I elect event compression, building the stack results in a flood of
   expose events for the widget on the bottom, with resultant redundant
   re-drawing.  How can I detect or avoid them?


Look at the event (structure) and see how many more expose events (that were
generated one after another) are left.  Redraw when this number
reaches(approaches) zero.
--

Anshuman Razdan

************************************************************
* razdan@toy			Test and Methodology Group *
*							   *
* razdan@phx.mcd.mot.com	Diablo Plant, Tempe  Az    *
************************************************************