Added support for X11's overrideRedirect functionality
This commit is contained in:
parent
113a77b219
commit
af271f99ec
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user