A minor xboard start-up bug

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

A minor xboard start-up bug

Post by sje »

A minor xboard start-up bug, seen on xterm output:

Code: Select all

xboard: messageWidget geometry error 1 520 21 520 21
User avatar
hgm
Posts: 28481
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: A minor xboard start-up bug

Post by hgm »

Does this result in any adverse effects? I found this error message in the following code:

Code: Select all

    gres = XtMakeResizeRequest(messageWidget, w, h, &wr, &hr);
    if (gres != XtGeometryYes && appData.debugMode) {
      fprintf(stderr, _("%s: messageWidget geometry error %d %d %d %d %d\n"),
	      programName, gres, w, h, wr, hr);
    }

    /* !! Horrible hack to work around bug in XFree86 4.0.1 (X11R6.4.3) */
    /* The size used for the child widget in layout lags one resize behind
       its true size, so we resize a second time, 1 pixel smaller.  Yeech! */
    w--;
    gres = XtMakeResizeRequest(messageWidget, w, h, &wr, &hr);
    if (gres != XtGeometryYes && appData.debugMode) {
      fprintf(stderr, _("%s: messageWidget geometry error %d %d %d %d %d\n"),
	      programName, gres, w, h, wr, hr);
    }
    /* !! end hack */
Apparently the Xt call does return code 1, which is not the desired code. No idea what this code means, I would have to look it up. The w and h parameters to the call seem correct values, presumably wr and hr are the actually obtained values of the widget size, but they could be hanging there from the first call,when it is the retry that causes the error (although then they should have had a one larger width).

Because this aparently happens in an area where the X toolkit is known to be buggy, I would not worry about it, unless there are real symptoms.

[Edit] It seems that XtGeometryYes is only returned when the requested size was the size the widget already had, and that in other cases XtGeometryDone is returned. From the code, it seems the second call should decrease the width by 1, so it would really be an error if it returned something else than XtGeometryDone. So it seems that the test for when toprint the errormessage is simply wrong.