From: H.G. Muller Date: Sun, 27 Sep 2009 19:24:30 +0000 (-0700) Subject: Opening Engine #1 Settings crashed XBoard when there were no text-edit options in... X-Git-Tag: v4.4.1.20091019~73 X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=1f1d93802643f38368e5847f4b2a09e62bbe32f6 Opening Engine #1 Settings crashed XBoard when there were no text-edit options in the dialog (to which to set keyboard focus) --- diff --git a/xoptions.c b/xoptions.c index 342246c..9bbd805 100644 --- a/xoptions.c +++ b/xoptions.c @@ -80,7 +80,6 @@ extern char *getenv(); extern void SendToProgram P((char *message, ChessProgramState *cps)); - extern Widget formWidget, shellWidget, boardWidget, menuBarWidget; extern Display *xDisplay; extern int squareSize; @@ -1082,7 +1081,7 @@ void NewVariantPopUp() "for missing bitmaps. (See manual.)")); j++; XtCreateManagedWidget("warning", labelWidgetClass, form, args, j); - XtRealizeWidget(popup); + XtRealizeWidget(popup); CatchDeleteWindow(popup, "NewVariantPopDown"); XQueryPointer(xDisplay, xBoardWindow, &root, &child, @@ -1476,7 +1475,7 @@ void CreateComboPopup(parent, name, n, mb) void SettingsPopUp(ChessProgramState *cps) { Arg args[16]; - Widget popup, layout, dialog, edit, form, oldform, last, b_ok, b_cancel, leftMargin = NULL; + Widget popup, layout, dialog, edit=NULL, form, oldform, last, b_ok, b_cancel, leftMargin = NULL; Window root, child; int x, y, i, j, height, width, h, c; int win_x, win_y; @@ -1490,7 +1489,7 @@ void SettingsPopUp(ChessProgramState *cps) if(cps->nrOptions > 50) width = 4; else if(cps->nrOptions>24) width = 2; else width = 1; height = cps->nrOptions / width + 1; - i = 0; + i = 0; XtSetArg(args[i], XtNresizable, True); i++; SettingsShell = popup = XtCreatePopupShell(_("Settings Menu"), transientShellWidgetClass, @@ -1508,7 +1507,7 @@ void SettingsPopUp(ChessProgramState *cps) XtSetArg(args[j], XtNfromHoriz, leftMargin); j++; XtSetValues(form, args, j); leftMargin = form; - + last = NULL; for(h=0; h