[comp.windows.x] Expose event delay

wam3090@yak.COM (Bill Massena) (04/23/91)

I have a situation in which an expose event can be generated as a result of
calling XtDestroyWidget.  If the XtDestroyWidget call is followed by a call
to XtMainLoop(), the expose event is processed.  If I instead use

	XSync(display, FALSE);
	while(XtPending()) {
		XtNextEvent(&event);
		XtDispatchEvent(&event);
	}

the expose event doesn't show up until the next XtMainLoop call, unless the
while loop is executed 30 times or so.  

I need to detect the expose event in the current state, which can change by the 
time XtMainLoop is called.  I thought that the XSync call would make this 
work.  Any suggestions as to what's wrong, or how to do this better?

Bill Massena