diff --git a/ChangeLog b/ChangeLog index 2ae04cf..48b436f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-07-25 Eric Wasylishen + + * Source/win32/w32_GLContext.m: + * Source/x11/XGGLContext.m: + Apply fix for bug 29705: OpenGL subwindow positioning error + (OpenGL subwindow position was incorrectly calculated when + the window content view was flipped) + 2010-07-25 Fred Kiefer * Source/x11/XGServerEvent.m: diff --git a/Source/win32/w32_GLcontext.m b/Source/win32/w32_GLcontext.m index 650e5a4..7f0bb11 100644 --- a/Source/win32/w32_GLcontext.m +++ b/Source/win32/w32_GLcontext.m @@ -137,6 +137,10 @@ LRESULT CALLBACK win32SubwindowProc( * we must therefore use content view coordinates. */ rect = [view convertRect: [view bounds] toView: [[attached window] contentView]]; + if ([[[attached window] contentView] isFlipped]) + { + rect.origin.y = NSHeight([[[attached window] contentView] frame]) - (rect.size.height + rect.origin.y); + } } else { @@ -210,6 +214,10 @@ LRESULT CALLBACK win32SubwindowProc( */ rect = [attached convertRect: [attached bounds] toView: [[attached window] contentView]]; + if ([[[attached window] contentView] isFlipped]) + { + rect.origin.y = NSHeight([[[attached window] contentView] frame]) - (rect.size.height + rect.origin.y); + } } else { diff --git a/Source/x11/XGGLContext.m b/Source/x11/XGGLContext.m index 985825d..04d47a2 100644 --- a/Source/x11/XGGLContext.m +++ b/Source/x11/XGGLContext.m @@ -104,6 +104,10 @@ */ rect = [view convertRect: [view bounds] toView: [window contentView]]; + if ([[window contentView] isFlipped]) + { + rect.origin.y = NSHeight([[window contentView] frame]) - (rect.size.height + rect.origin.y); + } } else { @@ -194,6 +198,10 @@ */ rect = [attached convertRect: [attached bounds] toView: [[attached window] contentView]]; + if ([[[attached window] contentView] isFlipped]) + { + rect.origin.y = NSHeight([[[attached window] contentView] frame]) - (rect.size.height + rect.origin.y); + } } else {