X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fmswin%2Ffg_state_mswin.c;h=91256a39ba9f106f6586b476b28d8746a9767ea8;hb=6a9540715abb6477b2a55e0a54246bfea66dfb95;hp=d5f441997f084a1209202020a66fbf7ba4159065;hpb=094c263eff25a3f7f9cf806661f89caf01d70026;p=freeglut diff --git a/src/mswin/fg_state_mswin.c b/src/mswin/fg_state_mswin.c index d5f4419..91256a3 100644 --- a/src/mswin/fg_state_mswin.c +++ b/src/mswin/fg_state_mswin.c @@ -183,6 +183,19 @@ int fgPlatformGlutGet ( GLenum eWhat ) GetWindowRect( fgStructure.CurrentWindow->Window.Handle, &winRect ); #else winRect = fghGetClientArea(fgStructure.CurrentWindow, FALSE); + if (fgStructure.CurrentWindow->Parent && (eWhat==GLUT_WINDOW_X || eWhat==GLUT_WINDOW_Y)) + { + /* For child window, we should return relative to upper-left + * of parent's client area. + */ + POINT topleft; + topleft.x = winRect.left; + topleft.y = winRect.top; + + ScreenToClient(fgStructure.CurrentWindow->Parent->Window.Handle,&topleft); + winRect.left = topleft.x; + winRect.top = topleft.y; + } #endif /* defined(_WIN32_WCE) */ switch( eWhat )