Bug Fixes
1. Dock Visibility Fix (Empty Dock Issue)
Problem: The Scene Tree View dock would appear empty (showing only the title bar with no content) after closing and reopening OBS in specific configurations:
- When positioned to the left of the video preview/viewer area
- When tabbed with another dock and the Scene Tree View was in a hidden/inactive tab
Root Cause: Double QDockWidget wrapping (both the plugin class and .ui file root were QDockWidget) combined with a widget detachment pattern that broke Qt's state restoration.
Solution:
- Refactored ObsSceneTreeView from QDockWidget to QWidget inheritance
- Updated .ui file root widget from QDockWidget to QWidget
- Removed broken widget detachment pattern
- Now uses direct registration via obs_frontend_add_dock_by_id()
- OBS creates and manages the QDockWidget wrapper automatically
Result: ✅ Dock contents now appear correctly in
all positions and tab states, including the previously problematic left/hidden-tab cases.
2. Content Sizing Fix (Layout Issue)
Problem: After the visibility fix, a new issue emerged where the dock's content widget did not fill the entire dock area. The tree view and toolbar appeared smaller than the dock boundary, leaving visible empty margins/gaps.
Root Cause: The .ui file defined STVDock (root widget) with a
fixed geometry but
no layout. The stvContents child widget had a layout, but since it wasn't managed by a layout on the parent STVDock, it didn't resize to fill the parent when the dock was resized by OBS.
Solution:
- Added a top-level QVBoxLayout to the STVDock root widget in forms/scene_tree_view.ui
- Ensured stvContents widget is managed by that parent layout
- Set all layout margins to 0 for seamless appearance
Result: ✅ Content now
properly fills the entire dock area when the dock is resized or repositioned, with no unexpected gaps.