Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When loading a layout close any orphaned windows #3115

Merged
merged 3 commits into from
Nov 9, 2023

Conversation

Zorro666
Copy link
Collaborator

@Zorro666 Zorro666 commented Nov 6, 2023

Description

Issue

  1. Default Layout (or any layout) : contains multiple windows but does not contain specific windows ie. Pipeline State
  2. Layout 1 contains windows which are not in the Default Layout i.e. Pipeline State window
  3. Load Default Layout
  4. Load Layout 1
  5. Load Default Layout
  6. 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 this 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.

QTRD 224632: [15:24:21]       MainWindow.cpp(3075) - Log     - SaveLayout  0
QTRD 224632: [15:24:25]       MainWindow.cpp(3091) - Log     - LoadLayout  1
QTRD 224632: [15:24:25] ToolWindowManager.cpp(1555) - Warning - area parameter ignored for this type
QTRD 224632: [15:24:25]       MainWindow.cpp(3111) - Log     - Manually closing orphaned window  "capDialog"
QTRD 224632: [15:24:30]       MainWindow.cpp(3091) - Log     - LoadLayout  0
QTRD 224632: [15:24:30] ToolWindowManager.cpp( 879) - Warning - invalid splitter encountered
QTRD 224632: [15:24:30]       MainWindow.cpp(3111) - Log     - Manually closing orphaned window  "meshPreview"
QTRD 224632: [15:24:30]       MainWindow.cpp(3111) - Log     - Manually closing orphaned window  "textureViewer"

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
@Zorro666 Zorro666 merged commit 769a261 into baldurk:v1.x Nov 9, 2023
16 checks passed
@Zorro666 Zorro666 deleted the ui-close-orphaned-windows branch November 9, 2023 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants