[osg-users] change focus between multiple windows

Sebastian Schmidt herrdersuppen at gmail.com
Mon Jan 8 06:57:02 PST 2018


My compositeviewer has two views, each containing a osgWidget::Canvas (window).
When i press a widget inside the first window, the second window should be restored (if minimized) and focused.
The restoring works but the second window stays in background.


Code:

osg::ref_ptr<osgViewer::GraphicsWindow> pWindow = windows[1];
int x;
int y;
int width;
int height;
pWindow->getWindowRectangle(x, y, width, height);
pWindow->setWindowDecoration(true);
pWindow->setWindowRectangle(x, y, width, height);
pWindow->grabFocus();




------------------------
OSG Version: 3.0.1
OS: OpenSuse Leap 42.1

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=72676#72676







More information about the osg-users mailing list