mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-08 15:51:01 +00:00
When loading a layout, force close any orphaned windows
An orphaned window has a NULL parent. An orphaned window is unable to be re-opened if it already exists in m_ToolWindows because when it tries to raise the existing window it does not have a valid parent
This commit is contained in:
@@ -3101,7 +3101,20 @@ bool MainWindow::LoadLayout(int layout)
|
||||
if(!success)
|
||||
return false;
|
||||
|
||||
return restoreState(state);
|
||||
if(restoreState(state))
|
||||
{
|
||||
// Close any windows which have now become orphaned
|
||||
foreach(QWidget *toolWindow, ui->toolWindowManager->toolWindows())
|
||||
{
|
||||
if(ui->toolWindowManager->areaOf(toolWindow) == NULL)
|
||||
{
|
||||
qInfo() << "Manually closing orphaned window " << toolWindow->objectName();
|
||||
ui->toolWindowManager->forceCloseToolWindow(toolWindow);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
qInfo() << "Couldn't load layout from " << path << " " << f.errorString();
|
||||
|
||||
Reference in New Issue
Block a user