VST3: Fix broken resizing in Ardour

Adds timer_proc lambda for VST3 to check for size mismatches and trigger
a new resize to correct it through eventual consistency.

This is done to workaround an X11 sync issue where the plugin view would
end up smaller or larger than its wrapper window. In Ardour this could
result in the plugin becoming uninteractable.
This commit is contained in:
Juuso Kaitila
2026-01-16 20:21:50 +02:00
committed by Robbert van der Helm
parent 945528cd7f
commit 604375b756
3 changed files with 67 additions and 1 deletions
+9
View File
@@ -204,6 +204,15 @@ class Editor {
*/
void resize(uint16_t width, uint16_t height);
/**
* Check if the wrapper window's actual X11 size matches the expected size.
* Returns the expected size if there's a mismatch, or nullopt if sizes
* match. This is used as a workaround for VST3 plugins where rapid
* resizing during mutual recursion can cause the X11 window to get stuck
* at an intermediate size.
*/
std::optional<Size> check_size_mismatch();
/**
* Show the window, should be called after the plugin has embedded itself.
* There's absolutely zero reason why this can't be done in the constructor,