From Jean-Sebastien Guay, "osgWidget::Window::setWindow() calls parented() (which does an addChild()) on the new window, but it does not call unparented() (which does a removeChild()) on the old window before. So it works fine if there was no window previously, but if an app creates new windows and calls setWindow() to replace the previous one, they will all add up instead and be on top of each other...
This is fixed in the file attached."
This commit is contained in:
@@ -115,6 +115,9 @@ bool Window::EmbeddedWindow::setWindow(Window* win) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_window.valid() && _parent)
|
||||
unparented(_parent);
|
||||
|
||||
_window = win;
|
||||
|
||||
_window->resize();
|
||||
|
||||
Reference in New Issue
Block a user