int junk;
Boolean singleList;
char *homeDir;
-int frameX, frameY; // width of window frame and title bar
void EnsureOnScreen(int *x, int *y, int minX, int minY);
char StringGet(void *getClosure);
// [HGM] placement: put all window layouts last in ini file, but man X,Y before all others
{ "minX", ArgZ, (void *) &minX, FALSE, INVALID }, // [HGM] placement: to make sure auxiliary windows can be placed
{ "minY", ArgZ, (void *) &minY, FALSE, INVALID },
- { "frameX", ArgInt, (void *) &frameX, XBOARD, (ArgIniType) 2 }, // [HGM] placement: correction for lying X11
- { "frameY", ArgInt, (void *) &frameY, XBOARD, (ArgIniType) 22 },
{ "winWidth", ArgInt, (void *) &wpMain.width, TRUE, INVALID }, // [HGM] placement: dummies to remember right & bottom
{ "winHeight", ArgInt, (void *) &wpMain.height, TRUE, INVALID }, // for attaching auxiliary windows to them
{ "x", ArgInt, (void *) &wpMain.x, TRUE, (ArgIniType) CW_USEDEFAULT },
Arg args[16];
Dimension w, h;
Position x, y;
- int i;
+ XWindowAttributes winAt;
+ Window win, dummy;
+ int i, rx, ry;
if(!wg) return;
- i = 0;
- XtSetArg(args[i], XtNx, &x); i++;
- XtSetArg(args[i], XtNy, &y); i++;
- XtSetArg(args[i], XtNwidth, &w); i++;
- XtSetArg(args[i], XtNheight, &h); i++;
- XtGetValues(wg, args, i);
- wp->x = x - frameX;
- wp->y = y - frameY;
- wp->height = h;
- wp->width = w;
+ win = XtWindow(wg);
+ XGetWindowAttributes(xDisplay, win, &winAt); // this works, where XtGetValues on XtNx, XtNy does not!
+ XTranslateCoordinates (xDisplay, win, winAt.root, -winAt.border_width, -winAt.border_width, &rx, &ry, &dummy);
+ wp->x = rx - winAt.x;
+ wp->y = ry - winAt.y;
+ wp->height = winAt.height;
+ wp->width = winAt.width;
}
void