[comp.windows.x] Expose Events on XConfigureWindow

eric@ontek.UUCP (Eric Hanson) (03/08/90)

I've got a personalized widget with an expensive drawing
algorithm, so I'm trying to use regions, etc. to cut
down on the waste. I've got one problem though I'm not sure 
I understand.

Whenever I decrease the size of the widget (thru XtResizeWidget), 
a single expose event is received with xywh matching the size
of the widget. However, since nothing in this widget is being
exposed, there SHOULDN'T be an expose event generated.

When I increease the size (along 1 axis only), two expose events
are received. The first has xywh == the new size, the second has
xywh == that portion which was "uncovered". In understand the latter of 
the two events, but the first doesn't make any sense.

My only guess is that the server generates an expose event
whenever XConfigureWindow is called. This doesn't make
much sense, but one of my X books (X Window System, Scheifler, 
Gettys, and Newman, p.36) hints at it.

Anyone with facts, opinions, or WAGS please E-Mail. Thanks...

P.S. I'm running X11R3 on a Sun 4, public-domain 1-bit server.

Eric Hanson                            uunet!ontek!eric
Ontek Corporation                      eric@ontek.com
Laguna Hills, CA                       eric@ontek.uucp

joel@decwrl.dec.com (Joel McCormack) (03/10/90)

The default bit-gravity for a window is Forget.  This means you get
Expose events upon reconfiguring because the server considers the window
contents to be ``lost.''  In your widget realize method, try setting the
bit-gravity attribute to NorthWest, and see if that gets rid of the
Expose events.  The server is free to consider bit-gravity as a hint,
and therefore ignore it, but the sample servers distributed by MIT
should actually use the information.

- Joel McCormack (decwrl!joel, joel@decwrl.dec.com)

mouse@LARRY.MCRCIM.MCGILL.EDU (der Mouse) (03/10/90)

> P.S. I'm running X11R3 on a Sun 4, public-domain 1-bit server.

Yow!  Where did you find a public-domain X server for a Sun, and can I
get one too?

					der Mouse

			old: mcgill-vision!mouse
			new: mouse@larry.mcrcim.mcgill.edu