From 0392efafea7e2eb8ce11b217d7ecd0d146526364 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 20 Jun 2011 11:25:52 +0000 Subject: [PATCH] Added catch for window manager doesn't set the window size to full screen. --- src/osgViewer/GraphicsWindowX11.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/osgViewer/GraphicsWindowX11.cpp b/src/osgViewer/GraphicsWindowX11.cpp index 7bbfbd677..e5982fbc9 100644 --- a/src/osgViewer/GraphicsWindowX11.cpp +++ b/src/osgViewer/GraphicsWindowX11.cpp @@ -877,6 +877,7 @@ bool GraphicsWindowX11::createWindow() unsigned int screenHeight; wsi->getScreenResolution(*_traits, screenWidth, screenHeight); + bool doFullSceenWorkAround = false; bool isFullScreen = x == 0 && y == 0 && width == (int)screenWidth && height == (int)screenHeight && !_traits->windowDecoration; if (isFullScreen && !_traits->overrideRedirect) { @@ -898,6 +899,8 @@ bool GraphicsWindowX11::createWindow() y = height/4; width /= 2; height /= 2; + + doFullSceenWorkAround = true; } } @@ -937,6 +940,7 @@ bool GraphicsWindowX11::createWindow() setWindowDecoration(_traits->windowDecoration); + useCursor(_traits->useCursor); _deleteWindow = XInternAtom (_display, "WM_DELETE_WINDOW", False); @@ -952,6 +956,18 @@ bool GraphicsWindowX11::createWindow() if (_traits->x != watt.x || _traits->y != watt.y ||_traits->width != watt.width || _traits->height != watt.height) { + + if (doFullSceenWorkAround) + { + OSG_INFO<<"Full Screen failed, resizing manually"<x, _traits->y, _traits->width, _traits->height); + + XFlush(_display); + XSync(_display, 0); + + XGetWindowAttributes( _display, _window, &watt ); + } + resized( watt.x, watt.y, watt.width, watt.height ); }