X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xoptions.c;h=15362a55205135816bac5ec7b4799d0197f9a48a;hb=434e83abf93ec88caffddb95ad15d03df27b984b;hp=528ab3ad19012760cd2fa5dccec7c806f03fb551;hpb=24f7a493a2d030011b0a4f883eaeeb6cbf991414;p=xboard.git diff --git a/xoptions.c b/xoptions.c index 528ab3a..15362a5 100644 --- a/xoptions.c +++ b/xoptions.c @@ -130,6 +130,16 @@ int dialogError; static Boolean browserUp; Option *dialogOptions[NrOfDialogs]; +static Arg layoutArgs[] = { + { XtNborderWidth, 0 }, + { XtNdefaultDistance, 0 }, +}; + +static Arg formArgs[] = { + { XtNborderWidth, 0 }, + { XtNresizable, (XtArgVal) True }, +}; + void GetWidgetText (Option *opt, char **buf) { @@ -387,11 +397,12 @@ char moveTypeInTranslations[] = "Escape: TypeInProc(0) \n"; extern char filterTranslations[]; extern char gameListTranslations[]; +extern char memoTranslations[]; -char *translationTable[] = { +char *translationTable[] = { // beware: order is essential! historyTranslations, commentTranslations, moveTypeInTranslations, ICSInputTranslations, - filterTranslations, gameListTranslations, + filterTranslations, gameListTranslations, memoTranslations }; void @@ -407,7 +418,8 @@ AddHandler (Option *opt, int nr) Widget shells[NrOfDialogs]; DialogClass parents[NrOfDialogs]; WindowPlacement *wp[NrOfDialogs] = { // Beware! Order must correspond to DialogClass enum - NULL, &wpComment, &wpTags, NULL, NULL, NULL, NULL, &wpMoveHistory, &wpGameList, &wpEngineOutput + NULL, &wpComment, &wpTags, NULL, NULL, NULL, NULL, &wpMoveHistory, &wpGameList, &wpEngineOutput, &wpEvalGraph, + NULL, NULL, NULL, NULL, &wpMain }; int @@ -725,6 +737,7 @@ GenericPopUp (Option *option, char *title, DialogClass dlgNr, DialogClass parent XtSetArg(args[i], XtNresizable, True); i++; shells[BoardWindow] = shellWidget; parents[dlgNr] = parent; + if(dlgNr == BoardWindow) popup = shellWidget; else popup = shells[dlgNr] = XtCreatePopupShell(title, !top || !appData.topLevel ? transientShellWidgetClass : topLevelShellWidgetClass, shells[parent], args, i); @@ -1054,16 +1067,17 @@ GenericPopUp (Option *option, char *title, DialogClass dlgNr, DialogClass parent } XtRealizeWidget(popup); - XSetWMProtocols(xDisplay, XtWindow(popup), &wm_delete_window, 1); - snprintf(def, MSG_SIZ, "WM_PROTOCOLS: GenericPopDown(\"%d\") \n", dlgNr); - XtAugmentTranslations(popup, XtParseTranslationTable(def)); - XQueryPointer(xDisplay, xBoardWindow, &root, &child, - &x, &y, &win_x, &win_y, &mask); - - XtSetArg(args[0], XtNx, x - 10); - XtSetArg(args[1], XtNy, y - 30); - XtSetValues(popup, args, 2); - + if(dlgNr != BoardWindow) { // assign close button, and position w.r.t. pointer, if not main window + XSetWMProtocols(xDisplay, XtWindow(popup), &wm_delete_window, 1); + snprintf(def, MSG_SIZ, "WM_PROTOCOLS: GenericPopDown(\"%d\") \n", dlgNr); + XtAugmentTranslations(popup, XtParseTranslationTable(def)); + XQueryPointer(xDisplay, xBoardWindow, &root, &child, + &x, &y, &win_x, &win_y, &mask); + + XtSetArg(args[0], XtNx, x - 10); + XtSetArg(args[1], XtNy, y - 30); + XtSetValues(popup, args, 2); + } XtPopup(popup, modal ? XtGrabExclusive : XtGrabNone); shellUp[dlgNr]++; // count rather than flag previous = NULL;