Fix VST2 editor resizing in REAPER

After solving this for VST3 plugins it become clear that REAPER required
us to do the exact same thing for VST2 plugins.
This commit is contained in:
Robbert van der Helm
2021-01-19 17:42:11 +01:00
parent d252ace189
commit 36535fc3b5
3 changed files with 65 additions and 21 deletions
+11
View File
@@ -187,4 +187,15 @@ class Vst2PluginBridge : PluginBridge<Vst2Sockets<std::jthread>> {
* now happens in two different threads.
*/
std::mutex incoming_midi_events_mutex;
/**
* REAPER requires us to call `audioMasterSizeWidnow()` from the same thread
* that's calling `effEditIdle()`. If we call this from any other thread,
* then the FX window won't be resized. To accommodate for this, we'll store
* the width and the height passed to the last call to
* `audioMasterSizeWindow`. If this contains a value, we'll then call
* `audioMasterSizeWindow()` with the new size during `effEditIdle()`.
*/
std::optional<std::pair<int, int>> incoming_resize;
std::mutex incoming_resize_mutex;
};