Skip to content

Commit

Permalink
VST3 Client: Ensure editor scale is correct immediately after creation
Browse files Browse the repository at this point in the history
This fixes a bug where selecting "Always on top" in the plugin editor
window in Cubase 11 on Windows 11 on a display with > 100% scale would
cause the editor to display with the wrong scale factor.

It seems that Cubase calls removed() then attached() on the plugin view,
destroying and recreating the editor wrapper component. The editor
opened with 100% scale, but requests from the host to set the "real"
scale factor were ignored because the JUCE wrapper thought that the
requested scale had already been applied.

Applying the cached scale factor directly after constructing the editor
keeps everything in a consistent state, and seems to resolve the issue.
  • Loading branch information
reuk committed Nov 24, 2021
1 parent 144b444 commit 6f80be1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp
Expand Up @@ -1951,6 +1951,9 @@ class JuceVST3EditController : public Vst::EditController,
&owner);

pluginEditor->setHostContext (editorHostContext.get());
#if ! JUCE_MAC
pluginEditor->setScaleFactor (owner.editorScaleFactor);
#endif

addAndMakeVisible (pluginEditor.get());
pluginEditor->setTopLeftPosition (0, 0);
Expand Down

0 comments on commit 6f80be1

Please sign in to comment.