mirror of
https://github.com/gnustep/libs-back.git
synced 2025-02-23 20:01:22 +00:00
Try to avoid value flip in window border computation.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@26136 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
47ca0b471e
commit
bec7259309
2 changed files with 16 additions and 11 deletions
|
@ -1,3 +1,8 @@
|
|||
2008-02-26 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/x11/XGServerWindow.m (-_checkStyle:): Restructure code
|
||||
for double parent handling to avoid wrong computation path.
|
||||
|
||||
2008-02-25 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/x11/XGServer.m (-_screenContextForScreen:): Remove wrong
|
||||
|
|
|
@ -996,17 +996,15 @@ _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 = repx + wattr.border_width;
|
||||
t = repy + wattr.border_width;
|
||||
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;
|
||||
r -= (window->xframe.size.width + l);
|
||||
b = wattr.height + wattr.border_width * 2;
|
||||
b -= (window->xframe.size.height + t);
|
||||
|
||||
// Some window manager e.g. KDE2 put in multiple windows,
|
||||
// so we have to find the right parent, closest to root
|
||||
|
@ -1022,8 +1020,6 @@ _get_next_prop_new_event(Display *display, XEvent *event, char *arg)
|
|||
{
|
||||
Window new_parent = parent;
|
||||
|
||||
r = wattr.width + wattr.border_width * 2;
|
||||
b = wattr.height + wattr.border_width * 2;
|
||||
while (new_parent && (new_parent != window->root))
|
||||
{
|
||||
Window root;
|
||||
|
@ -1050,15 +1046,19 @@ _get_next_prop_new_event(Display *display, XEvent *event, char *arg)
|
|||
if (new_parent && new_parent != window->root)
|
||||
{
|
||||
XGetWindowAttributes(dpy, parent, &wattr);
|
||||
l += wattr.x + wattr.border_width;
|
||||
t += wattr.y + wattr.border_width;
|
||||
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 */
|
||||
r -= (window->xframe.size.width + l);
|
||||
b -= (window->xframe.size.height + t);
|
||||
} /* generic.flags.doubleParentWindow */
|
||||
l += repx;
|
||||
t += repy;
|
||||
|
||||
o->l = l;
|
||||
o->r = r;
|
||||
|
|
Loading…
Reference in a new issue