-
-
Notifications
You must be signed in to change notification settings - Fork 117
Description
What happened?
Bug
The size of a Graph reverts to default on plugin window reopen; as a result, I can no longer scroll to access plugins now located outside the default boundaries.
Environment
- Element v1.0.0-73d9f52e (build 624) VST3
- REAPER v7.64 ARM64
- macOS 15.4.1 M1 Max
Reproduction steps
- Drag a node outside of the default boundaries to broaden the Graph size.
- Close and reopen Element plugin window.
Expected
The Graph retains its size after reopening and remains scroll-able.
Actual
The Graph reverts to default size, preventing scroll access to plugins outside the default boundaries.
Attachments
Version
1.0.0 (Latest)
Root Cause Analysis
The graph canvas size reverting to default on window reopen is caused by several interrelated issues.
1. restoreSettings() — size restoration is disabled (#if 0)
In src/ui/grapheditorview.cpp, the code that reads back the saved width/height and applies it to the editor canvas is completely commented out with #if 0. saveSettings() correctly writes the dimensions to the graph's UI ValueTree, but restoreSettings() never reads them back. This is the most direct cause.
2. GraphEditor::resized() resets _editor to viewport bounds
The resized() override in the GraphEditor wrapper class resets the inner _editor bounds to match the viewport whenever the editor appears smaller than the viewport. Even if restoration were re-enabled, this runs during the layout phase on window reopen and would immediately collapse the canvas back to viewport size.
3. graphDisplayResized() also forces _editor to the container area
GraphEditorView::graphDisplayResized() is triggered any time the container layout changes and unconditionally overwrites the canvas bounds with the container area. On window reopen the full layout/resize chain runs before any restoration, so this clobbers the previously saved canvas size.
4. saveSettings() timing — not called before getStateInformation()
saveSettings() (which persists the canvas dimensions into the ValueTree) is only called from willBeRemoved(). In a 3rd party host, getStateInformation() can be called at any time — e.g. on project save while the window is open — before willBeRemoved() has run. This means stale or zero canvas dimensions may be serialized into the host's project file.
5. getStateInformation() does not flush graph display state
session->saveGraphState() in PluginProcessor::getStateInformation() only calls savePluginState() per node (audio processor binary state). It does not trigger GraphEditorView::saveSettings(), so the graph canvas size in the UI ValueTree is only as current as the last time willBeRemoved() was called.
6. A fresh GraphEditorView is created with default size on window reopen
In PluginEditor::handleAsyncUpdate(), cc->setMainView(new GraphEditorView(graph)) creates a brand-new view starting at the hardcoded default (640×360). The graphNodeChanged() → restoreSettings() path is invoked, but because of issue #1, nothing is applied and the canvas stays at the default size.
Summary
The fix needs to address at minimum:
- Re-enable the size restoration logic in
restoreSettings()(issue LV2 Plugin Hosting Support #1), applied after the layout chain completes to avoid being immediately overwritten byresized()/graphDisplayResized()(issues Basic JACK Audio Driver #2, Customized Macros | Graph Parameters #3). - Ensure
GraphEditorView::saveSettings()is called beforegetStateInformation()serializes state, so the host always captures the latest canvas size (issues MIDI Keyboard F5 Key Never Gets Note Off #4, Hot-Swapped Graphs Don't Show Up In Recents #5).
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
