Skip to content

[Bug]: Graph size reverts to default on plugin window reopen #1085

@bountyshores

Description

@bountyshores

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

  1. Drag a node outside of the default boundaries to broaden the Graph size.
  2. 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

Image

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    guiUI and design specific issues

    Type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions