From 4fb67a720b10889285ebf2d0d7ac764aec14cff9 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Wed, 27 Apr 2022 19:26:39 +0200 Subject: [PATCH] Add a todo for fallback DPI scale detection --- src/wrapper/vst3/view.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/wrapper/vst3/view.rs b/src/wrapper/vst3/view.rs index 2d2f2e0d..74f3e724 100644 --- a/src/wrapper/vst3/view.rs +++ b/src/wrapper/vst3/view.rs @@ -457,6 +457,13 @@ impl IPlugView for WrapperView

{ impl IPlugViewContentScaleSupport for WrapperView

{ unsafe fn set_scale_factor(&self, factor: f32) -> tresult { + // TODO: So apparently Ableton Live doesn't call this function. Right now we'll hardcode the + // default scale to 1.0 on Linux and Windows since we can't easily get the scale from + // baseview. A better alternative would be to do the fallback DPI scale detection + // within NIH-plug itself. Then we can still only use baseview's system scale policy + // on macOS and both the editor implementation and the wrappers would know about the + // correct scale. + // On macOS scaling is done by the OS, and all window sizes are in logical pixels if cfg!(target_os = "macos") { nih_debug_assert_failure!("Ignoring host request to set explicit DPI scaling factor");