diff --git a/include/osgViewer/config/SingleWindow b/include/osgViewer/config/SingleWindow index 51a3fe0e2..9b88b0c33 100644 --- a/include/osgViewer/config/SingleWindow +++ b/include/osgViewer/config/SingleWindow @@ -23,9 +23,9 @@ class OSGVIEWER_EXPORT SingleWindow : public ViewConfig { public: - SingleWindow():_x(0),_y(0),_width(-1),_height(-1),_screenNum(0) {} - SingleWindow(int x, int y, int width, int height, unsigned int screenNum=0):_x(x),_y(y),_width(width),_height(height),_screenNum(screenNum) {} - SingleWindow(const SingleWindow& rhs, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):ViewConfig(rhs,copyop), _x(rhs._x),_y(rhs._y),_width(rhs._width),_height(rhs._height),_screenNum(rhs._screenNum) {} + SingleWindow():_x(0),_y(0),_width(-1),_height(-1),_screenNum(0),_border(true),_overrideRedirect(false) {} + SingleWindow(int x, int y, int width, int height, unsigned int screenNum=0):_x(x),_y(y),_width(width),_height(height),_screenNum(screenNum),_border(true),_overrideRedirect(false) {} + SingleWindow(const SingleWindow& rhs, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):ViewConfig(rhs,copyop), _x(rhs._x),_y(rhs._y),_width(rhs._width),_height(rhs._height),_screenNum(rhs._screenNum),_border(rhs._border), _overrideRedirect(rhs._overrideRedirect) {} META_Object(osgViewer,SingleWindow); @@ -46,10 +46,18 @@ class OSGVIEWER_EXPORT SingleWindow : public ViewConfig void setScreenNum(unsigned int sn) { _screenNum = sn; } unsigned int getScreenNum() const { return _screenNum; } + void setBorder(bool border) { _border = border; } + bool getBorder() const { return _border; } + + void setOverrideRedirect(bool override) { _overrideRedirect = override; } + bool getOverrideRedirect() const { return _overrideRedirect; } + protected: int _x, _y, _width, _height; unsigned int _screenNum; + bool _border; + bool _overrideRedirect; }; } diff --git a/src/osgViewer/config/SingleWindow.cpp b/src/osgViewer/config/SingleWindow.cpp index 3c585672f..0993a3ccc 100644 --- a/src/osgViewer/config/SingleWindow.cpp +++ b/src/osgViewer/config/SingleWindow.cpp @@ -41,7 +41,8 @@ void SingleWindow::configure(osgViewer::View& view) const traits->y = _y; traits->width = _width; traits->height = _height; - traits->windowDecoration = true; + traits->windowDecoration = _border; + traits->overrideRedirect = _overrideRedirect; traits->doubleBuffer = true; traits->sharedContext = 0; @@ -60,7 +61,7 @@ void SingleWindow::configure(osgViewer::View& view) const if (traits->width<=0) traits->width = width; if (traits->height<=0) traits->height = height; } - + osg::ref_ptr gc = osg::GraphicsContext::createGraphicsContext(traits.get()); view.getCamera()->setGraphicsContext(gc.get()); diff --git a/src/osgWrappers/serializers/osgViewer/SingleWindow.cpp b/src/osgWrappers/serializers/osgViewer/SingleWindow.cpp index 183953203..4b6c4d233 100644 --- a/src/osgWrappers/serializers/osgViewer/SingleWindow.cpp +++ b/src/osgWrappers/serializers/osgViewer/SingleWindow.cpp @@ -14,4 +14,6 @@ REGISTER_OBJECT_WRAPPER( osgViewer_SingleWindow, ADD_INT_SERIALIZER( Width, -1); ADD_INT_SERIALIZER( Height, -1); ADD_UINT_SERIALIZER( ScreenNum, 0u); + ADD_BOOL_SERIALIZER( Border, true); + ADD_BOOL_SERIALIZER( OverrideRedirect, true); }