Fixing the window position for asynchronous X11 implementations (e-mail by Jocelyn Frechot, Sun 11/25/2007 11:29 AM)
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@737 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
parent
872dbbc4ad
commit
9d2fccf853
@ -1315,35 +1315,24 @@ void FGAPIENTRY glutFullScreen( void )
|
|||||||
|
|
||||||
{
|
{
|
||||||
#if TARGET_HOST_POSIX_X11
|
#if TARGET_HOST_POSIX_X11
|
||||||
int x, y;
|
|
||||||
Window w;
|
|
||||||
|
|
||||||
XMoveResizeWindow(
|
Status status; /* Returned by XGetWindowAttributes(), not checked. */
|
||||||
fgDisplay.Display,
|
XWindowAttributes attributes;
|
||||||
|
|
||||||
|
status = XGetWindowAttributes(fgDisplay.Display,
|
||||||
fgStructure.CurrentWindow->Window.Handle,
|
fgStructure.CurrentWindow->Window.Handle,
|
||||||
0, 0,
|
&attributes);
|
||||||
|
/*
|
||||||
|
* The "x" and "y" members of "attributes" are the window's coordinates
|
||||||
|
* relative to its parent, i.e. to the decoration window.
|
||||||
|
*/
|
||||||
|
XMoveResizeWindow(fgDisplay.Display,
|
||||||
|
fgStructure.CurrentWindow->Window.Handle,
|
||||||
|
-attributes.x,
|
||||||
|
-attributes.y,
|
||||||
fgDisplay.ScreenWidth,
|
fgDisplay.ScreenWidth,
|
||||||
fgDisplay.ScreenHeight
|
fgDisplay.ScreenHeight);
|
||||||
);
|
|
||||||
|
|
||||||
XFlush( fgDisplay.Display ); /* This is needed */
|
|
||||||
|
|
||||||
XTranslateCoordinates(
|
|
||||||
fgDisplay.Display,
|
|
||||||
fgStructure.CurrentWindow->Window.Handle,
|
|
||||||
fgDisplay.RootWindow,
|
|
||||||
0, 0, &x, &y, &w
|
|
||||||
);
|
|
||||||
|
|
||||||
if (x || y)
|
|
||||||
{
|
|
||||||
XMoveWindow(
|
|
||||||
fgDisplay.Display,
|
|
||||||
fgStructure.CurrentWindow->Window.Handle,
|
|
||||||
-x, -y
|
|
||||||
);
|
|
||||||
XFlush( fgDisplay.Display ); /* XXX Shouldn't need this */
|
|
||||||
}
|
|
||||||
#elif TARGET_HOST_MS_WINDOWS && !defined(_WIN32_WCE) /* FIXME: what about WinCE */
|
#elif TARGET_HOST_MS_WINDOWS && !defined(_WIN32_WCE) /* FIXME: what about WinCE */
|
||||||
RECT rect;
|
RECT rect;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user