X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xhistory.c;h=5640fee7535f34f85d170a2242d33bfa8074701b;hb=762e18baef5f815cc46019ba3e082bd5ec1980f6;hp=7f02ab80fd6c4f2341abf48927d7ad5bd7deb8ca;hpb=86517e539f33650be656c482020a878fec0723c9;p=xboard.git diff --git a/xhistory.c b/xhistory.c index 7f02ab8..5640fee 100644 --- a/xhistory.c +++ b/xhistory.c @@ -90,7 +90,7 @@ struct History{ struct History *hist=0; String dots=" ... "; - +Position gameHistoryX, gameHistoryY; void HistoryPopDown(w, client_data, call_data) Widget w; @@ -98,20 +98,26 @@ HistoryPopDown(w, client_data, call_data) { Arg args[16]; int j; - if(hist) - - XtPopdown(hist->sh); - hist->Up=False; + if(hist) { + // [HGM] remember old position + j = 0; + XtSetArg(args[j], XtNx, &gameHistoryX); j++; + XtSetArg(args[j], XtNy, &gameHistoryY); j++; + XtGetValues(hist->sh, args, j); + XtPopdown(hist->sh); + hist->Up=False; + } j=0; XtSetArg(args[j], XtNleftBitmap, None); j++; - XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Move List"), + XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Move History"), args, j); } void HistoryMoveProc(Widget w, XtPointer closure, XtPointer call_data) { int to; + XawListReturnStruct *R = (XawListReturnStruct *) call_data; if (w == hist->mvn || w == hist->mvw) { to=2*R->list_index-1; @@ -445,6 +451,12 @@ Widget HistoryCreate() strcpy(hist->black[i],""); } + // [HGM] remember old position + j = 0; + XtSetArg(args[j], XtNx, &gameHistoryX); j++; + XtSetArg(args[j], XtNy, &gameHistoryY); j++; + XtGetValues(hist->sh, args, j); + return hist->sh; } @@ -456,9 +468,16 @@ HistoryPopUp() if(!hist) HistoryCreate(); XtPopup(hist->sh, XtGrabNone); + + // [HGM] restore old position + j = 0; + XtSetArg(args[j], XtNx, gameHistoryX); j++; + XtSetArg(args[j], XtNy, gameHistoryY); j++; + XtSetValues(hist->sh, args, j); + j=0; XtSetArg(args[j], XtNleftBitmap, xMarkPixmap); j++; - XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Move List"), + XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Move History"), args, j); hist->Up=True; }