diff --git a/WINGs/ChangeLog b/WINGs/ChangeLog index 920d41ef..1850724a 100644 --- a/WINGs/ChangeLog +++ b/WINGs/ChangeLog @@ -10,6 +10,7 @@ Changes since wmaker 0.80.0: - rewrote WMBox to use a WMArray for subviews. with this change fixed a bug about arranging subviews after removing one and a memleak occuring in the same case. +- Fixed WMGetViewScreenPosition() to consider the window decorations. Changes since wmaker 0.70.0: diff --git a/WINGs/wview.c b/WINGs/wview.c index c6bf9dde..df8b9902 100644 --- a/WINGs/wview.c +++ b/WINGs/wview.c @@ -724,12 +724,22 @@ WMGetViewScreenPosition(WMView *view) { WMScreen *scr = W_VIEW_SCREEN(view); Window foo; - int x, y; - + int x, y, topX, topY, bar; + WMView *topView; + + topView = view; + while (topView->parent && topView->parent!=scr->rootView) + topView = topView->parent; + + if (!XGetGeometry(scr->display, W_VIEW_DRAWABLE(topView), &foo, &topX, + &topY, &bar, &bar, &bar, &bar)) { + topX = topY = 0; + } + XTranslateCoordinates(scr->display, W_VIEW_DRAWABLE(view), scr->rootWin, 0, 0, &x, &y, &foo); - - return wmkpoint(x, y); + + return wmkpoint(x-topX, y-topY); }