[comp.windows.x] It just goes to show you...

ken@richsun.UUCP (Ken Marks) (04/06/89)

The "bug" we thought we found in Xt turned out to be a feature (i.e. it was
documented).  It turns out the fix was a bug... It turns out that it is 
perfectly reasonable to have a widget's resize routine called before it's 
realize routine - thus it's not valid to assume that you have a valid window id
(or valid window ids for any child widgets created in the realize).  The 
afternoon that I posted this "fix" to xbugs, we were bitten by the "fix"!
Oh well, I always did enjoy public humiliation...


The following exerpt is from the original posting.  Please unpatch this if any
of you were gullable enough to believe that I knew what I was doing ;-)

AREA:
	lib/Xt/Geometry.c

SYNOPSIS:
	In XtConfigureWidget(), a check is made to make sure the widget is
	realized before calling XConfigureWindow().  This check needs to
	be extended to the call to the widget's resize procedure.  It looks
	as though this second call might have been added later and the 
	braces were left out.

REPEAT BY:
	Call XtConfigureWidget() with a different height or width than the
	widget was created with.  Do this before the widget is realized and
	the client will get a protocol error when the widget's resize
	routine tries to use its yet undefined window id.  The circumstances
	we found it occuring is while realizing a composite widget which
	calls XtConfigureWidget() on it's children before the children get
	a change to get realized.