Skip to content

Commit

Permalink
Only return desized window size in Cubase. This fixes laggy VST3 size…
Browse files Browse the repository at this point in the history
… in FLSTudio + macOS, see Issue #888
  • Loading branch information
Guillaume Piolat committed Dec 12, 2024
1 parent ccc8729 commit c2ce3da
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
1 change: 1 addition & 0 deletions client/dplug/client/client.d
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ nothrow:
}

/// Only allowed for client implementation.
/// This is helpful for some hosts, like OBS and Cubase, but not others like FL Studio.
final bool getDesiredGUISize(int* widthLogicalPixels, int* heightLogicalPixels) nothrow @nogc
{
createGraphicsLazily();
Expand Down
32 changes: 26 additions & 6 deletions vst3/dplug/vst3/client.d
Original file line number Diff line number Diff line change
Expand Up @@ -1952,14 +1952,34 @@ nothrow:
scope(exit) _graphicsMutex.unlock();

int widthLogicalPixels, heightLogicalPixels;
if (_vst3Client._client.getDesiredGUISize(&widthLogicalPixels, &heightLogicalPixels))

// Different VST3 daws need to return different size :)
// Cubase like the "desired size" so that it can call during a resize.
// FLStudio and probably most hosts wants instead the former size.
// See Issue #888.
if (_daw == DAW.Cubase)
{
size.left = 0;
size.top = 0;
size.right = widthLogicalPixels;
size.bottom = heightLogicalPixels;
return kResultTrue;
if (_vst3Client._client.getDesiredGUISize(&widthLogicalPixels, &heightLogicalPixels))
{
size.left = 0;
size.top = 0;
size.right = widthLogicalPixels;
size.bottom = heightLogicalPixels;
return kResultTrue;
}
}
else
{
if (_vst3Client._client.getGUISize(&widthLogicalPixels, &heightLogicalPixels))
{
size.left = 0;
size.top = 0;
size.right = widthLogicalPixels;
size.bottom = heightLogicalPixels;
return kResultTrue;
}
}

return kResultFalse;
}

Expand Down

0 comments on commit c2ce3da

Please sign in to comment.