Cabbage 3 plugin window ignores windows dpi scaling (cabbage 2 plugins don’t)

hi everyone,

on windows at 125% display scale, vst3 plugins exported from cabbage 3 open smaller than expected (i tested with cubase, reaper and ableton), so they look too small next to the host ui. cabbage 2 plugins scale correctly in the same setup. the host-side options i tried [hidpi in cubase, auto-scale in ableton (works but not good quality), hidpi compatibility mode in reaper] either make no difference or only work by stretching and blurring the window. at 100% windows scale, the size is 1:1 in every host.

is there a setting to make the plugin window dpi-aware? if not, could this be considered as feature request?

im using windows 11, cubase 12,15, reaper 7.83, ableton 12.4.7 suite

thanks, all best -
parham

I’ll take a look a little later. Thanks for the report! :smiley:

@prhm.i This should be fixed now. I only have an arm build of Windows in a VM to test, but it seemed to work fine for me when I changed the display scale to 125% :+1: YOu can grab the latest package via Install Cabbage 3 | Cabbage

thank you rory, yes that works now on reaper but not with ableton or cubase

in ableton with compatibility on the gui is shaking and quality is more blury than before.

i tested both effects and synth exports
i installed vscabbage-3.0.15-beta-windows-x64.vsix from here Releases · rorywalsh/vscabbage · GitHub

i added script to the end of indx.html:

function fitToWindow() {
document.documentElement.style.zoom = 1 / (window.devicePixelRatio || 1);
}
fitToWindow();
window.addEventListener(‘resize’, fitToWindow);

and in the csd code in the “type” section i add:

“scaleSource”: “host”

it solved the problem (by zoom out the plugin - in reaper does not work )

but im not sure what i did. just wantedt to say if that helps

Thanks for testing @prhm.i :slight_smile:

"scaleSource”: “host” host is the default, so that shouldn’t be needed. I’m glad you found a solution, and it’s something we can fall back to if we can’t find a more native one.

We need to figure out what exactly Live is doing. Can you add this code to your index.html:

console.log('dpr', window.devicePixelRatio,
            'inner', window.innerWidth, window.innerHeight,
            'screen', window.screen.width, window.screen.height,
            'outer', window.outerWidth, window.outerHeight); 

That tells us:

  • devicePixelRatio – is WebView2 scaling the content (1.25) or not (1.0)?

  • innerWidth – the actual CSS viewport width

  • outerWidth – the physical/logical window width

You can access the console by right-clicking the plugin’s UI and launching the dev tools.

Can you also let me know the size properties of your form widget?

oh thanks.
so, the form size is 400x200 but i noticed that with the "scaleSource”: “os” first time the plugin opens, the window is 320x160 if i close the editor and open it again, the window is 400x200 and everything fits. so only the first open is wrong. (btw it loads very slowly compare to cabbage2 plugins.)

here some screenshots from the console data

this is from reaper with compatibility on:

and abletone with auto scale off:

and with this script

script2.txt (1.1 KB)

and "scaleSource”: “os” the first time it zoom out and after few ms it re-size to the 400x200 (right size). but still have the error

Thanks, let me take a look. Btw, when you say it’s taking a long time to open, do you mean when scaled, or just in general? The webview will take a few moments to load each time the editor is opened, but it shouldn’t really be noticeable. I notice your UI has 64 buttons, are they being generated dynamically? Or have you 64 different button widgets in your Cabbage 3 JSON section?

each time the editor opened. its not that long to be annoying but i just mentioned if thats something to do with scaling or concerning in general

testload1

testload2

buttons are generated inside an instr using “cabbageCreate”,

thanks very much

That whitescreen is a known issue with webviews. Let me look again and see if there isn’t now an elgant way of dealing with them. New build underway to address the scaling issue. It will be available here when it’s cooked 3.0.17-beta

Btw, are you getting that white screen every time you load your plugin UI?

Sorry, I re-read your post. I’ve pushed some changes just now that fall in line with how other plugin frameworks handle this issue. You should no longer see the white screen :crossed_fingers:

This version features the proposed fix for the white screen.

great, i dont know what happened but the scale is perfect now, and also the quality no shaking everything fits perfect. but the whilte-screen still there each time editor opens. with same loading time. did i do something wrong? i just installed vsix and export
still have"scaleSource”: “os” in my csd. (if i use "host" the size will not fit)

So using ‘host’ doesn’t work? Hmm, ‘os’ should only be the fallback. Can you confim the build number you’re running? I’m curious about that white screen. I can’t recreate on Mac because it uses a different webview.

i uninstalled all other version and C:\ProgramData\CabbageAudio files
then re-install again the 3.0.18-beta to be sure the result is the same.
“host” is not working and white-screen is still there

Darn it. I thought I had that sorted. Leave it with me. I’m curious to know what knock-on affect the DPI scaling might have if you share your plugin with someone else on Windows. Can you confirm that eerything is fine when no scaling is taking place? With scaleSource set to os still in place.

yes as far as i tested everything is good. with no scale, both "os" and"host" are fine. the only issue now is the white screen. (i also tired to use vs3 in vm win10 but ui was all white)

I wonder if my upstream changes made it into that build. I had to update two dependencies. I’m running off another build now that will definitely have the changes in it. If it still doesn’t work I guess I need to look to another solution. I’ll let you know when that next build is complete.

Can you try this one: Release 3.0.19-beta · rorywalsh/vscabbage · GitHub I just need to confirm the recent changes are part of the build.

i tested it and it seems all the same:
125% scale: “os” is okay but “host” is not
100% scale: both are fine
the only difference now is that when i want to change these setting i have to restart the daw.
(and also cabbageCreate is not working if i dont restart)

but now there is another issue:
when i click outside the editor it close by itself - the editor icon in the daw still on ( only with cubasse 12)

That’s odd, I can’t think of any reason this would be happening. Can you verify that ‘Always on top’ is enabled in the settings? Or can you quickly try another plugin to make sure it’s unique to Cabbage 3. Sorry for having to ask you to do these tests. I have a copy of Cubase, but it’s on my work machine, and I won’t be there till Monday. I appreciate the effort. In the meantime I’ll keep working on the white-screen issue.