1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-05 05:14:13 +01:00

- Fixed WMGetViewScreenPosition() to consider the window decorations.

This commit is contained in:
dan
2002-03-04 08:52:49 +00:00
parent efcf27f854
commit 84fa789cd6
2 changed files with 15 additions and 4 deletions

View File

@@ -10,6 +10,7 @@ Changes since wmaker 0.80.0:
- rewrote WMBox to use a WMArray for subviews. with this change fixed a bug - 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 about arranging subviews after removing one and a memleak occuring in the
same case. same case.
- Fixed WMGetViewScreenPosition() to consider the window decorations.
Changes since wmaker 0.70.0: Changes since wmaker 0.70.0:

View File

@@ -724,12 +724,22 @@ WMGetViewScreenPosition(WMView *view)
{ {
WMScreen *scr = W_VIEW_SCREEN(view); WMScreen *scr = W_VIEW_SCREEN(view);
Window foo; 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), XTranslateCoordinates(scr->display, W_VIEW_DRAWABLE(view),
scr->rootWin, 0, 0, &x, &y, &foo); scr->rootWin, 0, 0, &x, &y, &foo);
return wmkpoint(x, y); return wmkpoint(x-topX, y-topY);
} }