- if ( window->Parent == NULL )
- {
- if ( ! window->IsMenu && (window != fgStructure.GameModeWindow) &&
- !( fgState.DisplayMode & GLUT_BORDERLESS ))
- {
- w += GetSystemMetrics( SM_CXSIZEFRAME ) * 2;
- h += GetSystemMetrics( SM_CYSIZEFRAME ) * 2 +
- GetSystemMetrics( SM_CYCAPTION );
- }
- }
+ /* Create rect in FreeGLUT format, (X,Y) topleft outside window, WxH of client area */
+ windowRect.right = windowRect.left+width;
+ windowRect.bottom = windowRect.top+height;
+
+ if (window->Parent == NULL)
+ /* get the window rect from this to feed to SetWindowPos, correct for window decorations */
+ fghComputeWindowRectFromClientArea_QueryWindow(window,&windowRect,TRUE);