Add an option to disable VST3 content scaling

This might be necessary when using a HiDPI screen as plugin GUIs often
don't scale correctly under Wine.
This commit is contained in:
Robbert van der Helm
2021-01-14 17:36:00 +01:00
parent 07e84c78b3
commit 5dcedbace5
6 changed files with 52 additions and 12 deletions
+6
View File
@@ -113,6 +113,12 @@ Configuration::Configuration(const fs::path& config_path,
} else {
invalid_options.push_back(key);
}
} else if (key == "vst3_no_scaling") {
if (const auto parsed_value = value.as_boolean()) {
vst3_no_scaling = parsed_value->get();
} else {
invalid_options.push_back(key);
}
} else {
unknown_options.push_back(key);
}
+10
View File
@@ -122,6 +122,15 @@ class Configuration {
*/
std::optional<float> frame_rate;
/**
* Disable `IPlugViewContentScaleSupport::setContentScaleFactor()`. Wine
* does not properly implement DPI scaling, so without this option plugins
* using GDI+ would draw their editor GUIs at the normal size even though
* their window would actually be scaled. That would result in giant black
* borders at the top and the right of the window.
*/
bool vst3_no_scaling = false;
/**
* The name of the plugin group that should be used for the plugin this
* configuration object was created for. If not set, then the plugin should
@@ -165,6 +174,7 @@ class Configuration {
s.value1b(editor_xembed);
s.ext(frame_rate, bitsery::ext::StdOptional(),
[](S& s, auto& v) { s.value4b(v); });
s.value1b(vst3_no_scaling);
s.ext(group, bitsery::ext::StdOptional(),
[](S& s, auto& v) { s.text1b(v, 4096); });