Default Layout (or any layout) : contains multiple windows but does not contain a specific window ie. Pipeline State
Layout 1 contains windows which are not in the Default Layout i.e. Pipeline State window
Load Default Layout
Load Layout 1
Load Default Layout
Now unable to open the Pipeline State window because it has become orphaned (no parent) from any tool window manager. Have to restart RenderDoc to be able to open the orphaned windows.
Discussion
Another solution to the problem would be to pass a valid default tool area to the raiseToolWindow similar to how it is done for addToolWindow and use the default tool area if the window has become orphaned.
this would required touching all calls to raiseToolWindow (approximately 45 instances)
The orphaned windows will still be in m_ToolWindows so anything iterating over that container and sending events could be sending events to ToolWindows which are not visible.
Orphaned windows will not close using closeToolWindow API which might lead to invalid ToolWindow's i.e. ToolWindow's referencing a capture that has been closed but the ToolWindow itself became orphaned
The extra logging will help to identify if the scenario is happening
Extra Changes
Added more logging to help diagnose window manager warnings.
Added logging for when layouts are saved and loaded to help understand how often that happens when looking at log files from users.
Testing
Following steps mentioned end up with logs like this and are able to open windows which without the fix had not been able to open.
Description
Issue
Pipeline State
Pipeline State
windowPipeline State
window because it has become orphaned (no parent) from any tool window manager. Have to restart RenderDoc to be able to open the orphaned windows.Discussion
raiseToolWindow
similar to how it is done foraddToolWindow
and use the default tool area if the window has become orphaned.raiseToolWindow
(approximately 45 instances)m_ToolWindows
so anything iterating over that container and sending events could be sending events to ToolWindows which are not visible.closeToolWindow
API which might lead to invalid ToolWindow's i.e. ToolWindow's referencing a capture that has been closed but the ToolWindow itself became orphanedExtra Changes
Testing
Following steps mentioned end up with logs like this and are able to open windows which without the fix had not been able to open.