\r
void SampleKeyboard( unsigned char cChar, int nMouseX, int nMouseY );\r
void Redisplay();\r
-void Reshape(int x, int y);\r
+void Reshape(int width, int height);\r
+void Position(int x, int y);\r
\r
\r
\r
glutKeyboardFunc( SampleKeyboard );\r
glutDisplayFunc( Redisplay );\r
glutReshapeFunc( Reshape );\r
+ glutPositionFunc( Position );\r
}\r
else\r
{\r
SFG_Window* saved_window = fgStructure.CurrentWindow;
RECT windowRect;
GetWindowRect( window->Window.Handle, &windowRect );
+
+ if (window->Parent)
+ {
+ /* For child window, we should return relative to upper-left
+ * of parent's client area.
+ */
+ POINT topleft = {windowRect.left,windowRect.top};
+
+ ScreenToClient(window->Parent->Window.Handle,&topleft);
+ windowRect.left = topleft.x;
+ windowRect.top = topleft.y;
+ }
INVOKE_WCB( *window, Position, ( windowRect.left, windowRect.top ) );
fgSetWindow(saved_window);