From: H.G. Muller Date: Sun, 22 Nov 2009 20:34:13 +0000 (-0800) Subject: fix the irritating wandering off of the MoveHistory window in XBoard on opening/closing. X-Git-Tag: v4.4.2.20091122~1 X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=57a86b65b29bfbd0c485aa39f8cbf96486e3d882 fix the irritating wandering off of the MoveHistory window in XBoard on opening/closing. --- diff --git a/xhistory.c b/xhistory.c index c2ac392..6f94e62 100644 --- a/xhistory.c +++ b/xhistory.c @@ -94,6 +94,7 @@ struct History{ struct History *hist=0; String dots=" ... "; Position gameHistoryX, gameHistoryY; +Dimension gameHistoryW; void HistoryPopDown(w, client_data, call_data) @@ -103,12 +104,6 @@ HistoryPopDown(w, client_data, call_data) Arg args[16]; int j; 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; } @@ -401,6 +396,18 @@ Widget HistoryCreate() strcpy(hist->black[i],""); } + // [HGM] restore old position + j = 0; + XtSetArg(args[j], XtNx, &gameHistoryX); j++; + XtSetArg(args[j], XtNy, &gameHistoryY); j++; + XtSetArg(args[j], XtNwidth, &gameHistoryW); j++; + XtGetValues(shellWidget, args, j); + j = 0; + XtSetArg(args[j], XtNx, gameHistoryX + gameHistoryW); j++; + XtSetArg(args[j], XtNy, gameHistoryY); j++; + XtSetValues(hist->sh, args, j); + XtRealizeWidget(hist->sh); + return hist->sh; } @@ -414,12 +421,6 @@ HistoryPopUp() 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 History"),