diff --git a/src/osgViewer/GraphicsWindowX11.cpp b/src/osgViewer/GraphicsWindowX11.cpp index 42148ee36..9a1379704 100644 --- a/src/osgViewer/GraphicsWindowX11.cpp +++ b/src/osgViewer/GraphicsWindowX11.cpp @@ -962,11 +962,14 @@ bool GraphicsWindowX11::createWindow() XFlush( _display ); XSync( _display, 0 ); - // now update the window dimensions to account for any size changes made by the window manager, - XGetWindowAttributes( _display, _window, &watt ); - if (_traits->x != watt.x || _traits->y != watt.y - ||_traits->width != watt.width || _traits->height != watt.height) + // get window geometry relative to root window/screen + Window child_return; + int windowX, windowY; + XGetWindowAttributes( _display, _window, &watt ); + XTranslateCoordinates( _display, _window, watt.root, watt.x, watt.y, &windowX, &windowY, &child_return); + + if (_traits->x != windowX || _traits->y != windowY ||_traits->width != watt.width || _traits->height != watt.height) { if (doFullSceenWorkAround) @@ -978,9 +981,10 @@ bool GraphicsWindowX11::createWindow() XSync(_display, 0); XGetWindowAttributes( _display, _window, &watt ); + XTranslateCoordinates( _display, _window, watt.root, watt.x, watt.y, &windowX, &windowY, &child_return); } - resized( watt.x, watt.y, watt.width, watt.height ); + resized( windowX, windowY, watt.width, watt.height ); } //OSG_NOTICE<<"After sync apply.x = "<(ev.xclient.data.l[0]) == _deleteWindow) { - OSG_NOTICE<<"DeleteWindow event received"<closeWindow(eventTime); } @@ -1252,15 +1256,13 @@ bool GraphicsWindowX11::checkEvents() break; case DestroyNotify : - OSG_NOTICE<<"DestroyNotify event received"<x || windowY != _traits->y || windowWidth != _traits->width || windowHeight != _traits->height) { + resized(windowX, windowY, windowWidth, windowHeight); getEventQueue()->windowResize(windowX, windowY, windowWidth, windowHeight, resizeTime);