[comp.windows.x] bug in xman?

chucks@sne42n.orl.mmc.COM (02/19/91)

 I am having a problem with xman going into a hard loop. I have traced the problem
 to the format routine in misc.c. the code where the problem is:

 while ( !XCheckTypedWindowEvent(XtDisplay(man_globals->standby),
                                  XtWindow(man_globals->standby),
                                  Expose, &event) );
  XtDispatchEvent( &event );
  XFlush(XtDisplay(man_globals->standby));

 If an expose event for the window never happens then the while loop is
stuck forever.
 This is exactly what I see happening.
 Question: 

 Why is it necessary to wait for the expose. If you are going to dispatch the
 expose and then flush the buffer, couldnt you just flush the buffer and generate
 your own expose. Or is there a much deeper reason for the method you used.

 thanks,


 X11R4-pl18, SUNos 4.1.1, sun cc


Malcolm Strickland         		    chucks@iplmail.orl.mmc.com
Martin Marietta Electronic Systems 	    407-356-5909

kit@ics.COM (02/19/91)

> I am having a problem with xman going into a hard loop. I have traced the problem
> to the format routine in misc.c. the code where the problem is:

> while ( !XCheckTypedWindowEvent(XtDisplay(man_globals->standby),
>                                  XtWindow(man_globals->standby),
>                                  Expose, &event) );
>  XtDispatchEvent( &event );
>  XFlush(XtDisplay(man_globals->standby));

> If an expose event for the window never happens then the while loop is
> stuck forever.
>  This is exactly what I see happening.

This code is waiting for the expose event to occure on the little window that
pops up on the screen to tell you that you that xman is formatting your
manual page for you.  Since xman is going off to do the formattting it is not
able to process events.  In order to get the text displayed on the screen it
must make sure that the expose event on its label get called.  Therefore it 
hangs around waiting for an expose event to come on the label widget
with the text in it.

The problem you are having may occure if the window is somehow left on the
bottom of the window stack and never exposed.  This should never happen since Xt
should be doing an XMapRaised on the XtPopup call.  Do you know where this
window is popping up on your screen, and why it is not visible to the user and
thus not getting an expose event?  Perhaps you can fix the problem with an
XRaiseWindow call on the shell containing this button, but as I said earlier
this "shouldn't" matter.

Yes, I did know that this could possiblly loop, but I thought I covered all
cases in making sure that the label would eventually get put on the screen 
where it will get an expose event.  Apperently I have missed one.  I hope this
helps you track down the problem.

> Question: 

> Why is it necessary to wait for the expose. If you are going to dispatch the
> expose and then flush the buffer, couldnt you just flush the buffer and generate
> your own expose. Or is there a much deeper reason for the method you used.

> thanks,

This expose "should" eventually come, for the reasons stated above.  If I
generate my own expose then I will get one later as well.  Since I "knew" the
expose would come I just decided to wait for it.  Besides I have a fundamental
problem with XSendEvent.  I think it gets used far too often to hack around
problmes, rather than trying to find real solutions.


					Chris D. Peterson     
					Integrated Computer Solutions, Inc.

Net:	 kit@ics.com
Phone:   (617) 621 - 0060
Address: 201 Broadway, Cambridge, MA 02139