git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1701
7f0cb862-5218-0410-a997-
914c9d46530a
case GLUT_WINDOW_HEADER_HEIGHT:
{
int x, y;
case GLUT_WINDOW_HEADER_HEIGHT:
{
int x, y;
if( fgStructure.CurrentWindow == NULL )
return 0;
if( fgStructure.CurrentWindow == NULL )
return 0;
+ if (fgStructure.CurrentWindow->Parent)
+ /* For child window, we should return relative to upper-left
+ * of parent's client area.
+ */
+ p = fgStructure.CurrentWindow->Parent->Window.Handle;
+ else
+ p = fgDisplay.pDisplay.RootWindow;
+
XTranslateCoordinates(
fgDisplay.pDisplay.Display,
fgStructure.CurrentWindow->Window.Handle,
XTranslateCoordinates(
fgDisplay.pDisplay.Display,
fgStructure.CurrentWindow->Window.Handle,
- fgDisplay.pDisplay.RootWindow,
0, 0, &x, &y, &w);
switch ( eWhat )
0, 0, &x, &y, &w);
switch ( eWhat )
case GLUT_WINDOW_Y: return y;
}
case GLUT_WINDOW_Y: return y;
}
+ if ( w == 0 || fgStructure.CurrentWindow->Parent)
+ /* logic below needs w, and child windows don't have borders */
return 0;
XTranslateCoordinates(
fgDisplay.pDisplay.Display,
return 0;
XTranslateCoordinates(
fgDisplay.pDisplay.Display,