Coordinate bugfix for opengl

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@24349 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2007-01-14 17:03:44 +00:00
parent 3fbe4b61c4
commit b5bde71d60
2 changed files with 22 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2007-01-14 Richard Frith-Macdonald <rfm@gnu.org>
* Source/x11/XGGLContext.m: Fixup coordinates of subwindow for
bug report by Xavier Glattard.
2006-12-31 Fred Kiefer <FredKiefer@gmx.de>
* Source/cairo/CairoGState.m (-setOffset:, -DPSinitmatrix): Use

View file

@ -80,7 +80,23 @@
win_info = [XGServer _windowWithTag: [win windowNumber]];
NSAssert(win_info, NSInternalInconsistencyException);
rect = [view convertRect: [view bounds] toView: nil];
if ([server handlesWindowDecorations] == YES)
{
/* The window manager handles window decorations, so the
* the parent X window is equal to the content view and
* we must therefore use content view coordinates.
*/
rect = [view convertRect: [view bounds]
toView: [[view window] contentView]];
}
else
{
/* The GUI library handles window decorations, so the
* the parent X window is equal to the NSWindow frame
* and we can use window base coordinates.
*/
rect = [view convertRect: [view bounds] toView: nil];
}
x = NSMinX(rect);
y = NSHeight(win_info->xframe) - NSMaxY(rect);