X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xboard.c;h=77a73c4596c9604df5f08737dd86894f5babaf50;hb=c6dc8d81c81b393e2de7eaebd356966db34c2008;hp=a1a41b9a0d75eb5150a10a4ce890d3e08d9a810a;hpb=a6ae4e1711147118d14b51ff929e15b7198ba5f7;p=xboard.git diff --git a/xboard.c b/xboard.c index a1a41b9..77a73c4 100644 --- a/xboard.c +++ b/xboard.c @@ -1562,20 +1562,19 @@ GetActualPlacement (Widget wg, WindowPlacement *wp) 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