Correct code for double parent handling.

Patch by Wolfgang Lux <wolfgang.lux@gmail.com>.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@26950 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2008-10-22 07:36:10 +00:00
parent 6c257ccc1f
commit c6c8160a30
2 changed files with 19 additions and 17 deletions

View file

@ -1,3 +1,9 @@
2008-10-22 Fred Kiefer <FredKiefer@gmx.de>
* Source/x11/XGServerWindow.m (-_checkStyle:): Correct code
for double parent handling.
Patch by Wolfgang Lux <wolfgang.lux@gmail.com>.
2008-10-17 Fred Kiefer <FredKiefer@gmx.de>
* Headers/win32/WIN32Geometry.h (MSScreenRectToGS, GSScreenRectToMS),

View file

@ -996,15 +996,8 @@ _get_next_prop_new_event(Display *display, XEvent *event, char *arg)
XGetWindowAttributes(dpy, parent, &wattr);
NSDebugLLog(@"Offset", @"Parent border,width,height %d,%d,%d\n",
wattr.border_width, wattr.width, wattr.height);
l = wattr.border_width;
t = wattr.border_width;
/* Find total parent size and subtract window size and
* top-left-corner offset to determine bottom-right-corner
* offset.
*/
r = wattr.width + wattr.border_width * 2;
b = wattr.height + wattr.border_width * 2;
l = repx + wattr.border_width;
t = repy + wattr.border_width;
// Some window manager e.g. KDE2 put in multiple windows,
// so we have to find the right parent, closest to root
@ -1019,14 +1012,16 @@ _get_next_prop_new_event(Display *display, XEvent *event, char *arg)
|| (repx == 0 && repy == 0))
{
Window new_parent = parent;
Window root = window->root;
while (new_parent && (new_parent != window->root))
{
Window root;
Window *children = 0;
unsigned int nchildren;
parent = new_parent;
repx = wattr.x;
repy = wattr.y;
NSLog(@"QueryTree window is %d (root %d cwin root %d)",
parent, root, window->root);
if (!XQueryTree(dpy, parent, &root, &new_parent,
@ -1045,20 +1040,21 @@ _get_next_prop_new_event(Display *display, XEvent *event, char *arg)
}
if (new_parent && new_parent != window->root)
{
XGetWindowAttributes(dpy, parent, &wattr);
XGetWindowAttributes(dpy, new_parent, &wattr);
l += repx + wattr.border_width;
t += repy + wattr.border_width;
r = wattr.width + wattr.border_width * 2;
b = wattr.height + wattr.border_width * 2;
repx = wattr.x;
repy = wattr.y;
}
} /* while */
} /* generic.flags.doubleParentWindow */
/* Find total parent size and subtract window size and
* top-left-corner offset to determine bottom-right-corner
* offset.
*/
r = wattr.width + wattr.border_width * 2;
r -= (window->xframe.size.width + l);
b = wattr.height + wattr.border_width * 2;
b -= (window->xframe.size.height + t);
l += repx;
t += repy;
o->l = l;
o->r = r;