vst.net
vst.net copied to clipboard
PluginCommandStub.Commands.EditorGetRect(out Rectangle wndRect) seems to always return Rect(X=0, Y=0, Width=400, Height=300)
Describe the bug
I am so far only using Jacobi.Vst.Samples.Host with https://www.reaper.fm/reaplugs/.
Whenever I show any of their Editors, the returned Rect size is always 400x300.

To Reproduce Steps to reproduce the behavior:
- Install https://www.reaper.fm/reaplugs/
- Launch Jacobi.Vst.Samples.Host, load any of the plugins
- Set a breakpoint at EditorFrame.ShowDialog call to PluginCommandStub.Commands.EditorGetRect
- View the plugin's Editor
Expected behavior The plugin returns the correct Rect size. I have stepped through the code in OBS Studio and it loads the correct Rect size from all reaplugs.
Actual behavior
Rect size always comes back as Rect(X=0, Y=0, Width=400, Height=300)
Desktop:
- OS: Windows 10 Pro 21H1 19043.1889
See https://github.com/NightVsKnight/vst.net/commit/855f6291e2134c3554a93be10f864b1868ced7f3
It returns non-400x300 rect when queried in OnLoad, which appears to be the more appropriate place to resize the control.
My guess is that this plugin just returns 400x300 as a default value until it has initialized fully.
I have enhanced the Host Sample to implement a more robust Window Size handling of the plugin editor window.
The EditorGetRect call after the plugin has initialize yield more sensible values.
I have also forwarded the SizeWindow call on the host command stub to the EditorFrame. This would allow dynamically sizing plugin editors to adjust the containing editor window.