@begin(header)
author: ackerman=ag@ics.uci.edu
show_author: ShowNone
author_organization: MIT
node_expert: ackerman=ag@ics.uci.edu 
expiration_date: 10/10/93
last_modifier: ackerman=ag@ics.uci.edu
last_mod_date: 10/10/91
mod_num: 1
@end(header)
--------------
Debugging Xlib
--------------

The most typical run-time errors for an Xlib program are:

@begin(1)
No window appears.

Check to make sure that you have mapped your window with an
XMapWindow.  If you do not map the window to the screen, it
will not appear.
@end(1)

@begin(2)
Some drawing is lost at the beginning of execution.

You can *not* reliably draw before the first expose event for a
window.  (Actually you can start drawing on the mapnotify event,
but it is usually easier just to draw on the expose event.)  If you
draw before the first expose event, any drawing you do may get
lost because of the latency between the time your program maps
the window and the time the window manager agrees to the mapping.
@end(2)

@begin(3)
Drawing is lost when the program is covered and then uncovered.

With certain exceptions, your program must be ready to handle
redrawing on expose events.  The expose event is generated when
your program is required by the server to refresh some window;
ie, the contents of the window have now become unknown.  One
such example is when your window is covered by another and then
uncovered.  
@end(3)

If your problem is not one of the above (or you are not sure
whether it is), ask for more information by clicking on the
"I'm Unhappy" button below.
