Added support for X11's overrideRedirect functionality

This commit is contained in:
Robert Osfield 2008-06-21 17:50:58 +00:00
parent 113a77b219
commit af271f99ec
3 changed files with 10 additions and 3 deletions

View File

@ -92,7 +92,8 @@ class OSG_EXPORT GraphicsContext : public Object
useMultiThreadedOpenGLEngine(false),
useCursor(true),
sharedContext(0),
setInheritedWindowPixelFormat(false) {}
setInheritedWindowPixelFormat(false),
overrideRedirect(false) {}
// graphics context original and size
int x;
@ -145,6 +146,9 @@ class OSG_EXPORT GraphicsContext : public Object
// ask the GraphicsWindow implementation to set the pixel format of an inherited window
bool setInheritedWindowPixelFormat;
// X11 hint whether to override the window managers window size/position redirection
bool overrideRedirect;
};

View File

@ -84,6 +84,8 @@ static osg::GraphicsContext::Traits* buildTrait(RenderSurface& rs)
traits->sharedContext = 0;
traits->pbuffer = (rs.getDrawableType()==osgProducer::RenderSurface::DrawableType_PBuffer);
traits->overrideRedirect = rs.usesOverrideRedirect();
return traits;
}

View File

@ -655,11 +655,12 @@ bool GraphicsWindowX11::createWindow()
swatt.event_mask = 0;
unsigned long mask = CWBackPixel | CWBorderPixel | CWEventMask | CWColormap;
bool overrideRedirect = false;
if (overrideRedirect)
if (_traits->overrideRedirect)
{
swatt.override_redirect = true;
mask |= CWOverrideRedirect;
osg::notify(osg::NOTICE)<<"Setting override redirect"<<std::endl;
}
_window = XCreateWindow( _display, _parent,