From 548ee2438c96a43311f5a79c52b57652127e5080 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sun, 22 Nov 2009 12:34:13 -0800 Subject: [PATCH] fix the irritating wandering off of the MoveHistory window in XBoard on opening/closing. --- xhistory.c | 25 +++++++++++++------------ 1 files changed, 13 insertions(+), 12 deletions(-) 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"), -- 1.7.0.4