clap icon indicating copy to clipboard operation
clap copied to clipboard

On-the-fly DPI changes support?

Open sjoerdk-of opened this issue 1 year ago • 4 comments

Hi!

Playing around with reaper I found that system dpi settings are only applied when the plugin gui is first opened. That matches the description over here https://github.com/free-audio/clap/blob/main/include/clap/ext/gui.h, so i guess that's the way it's supposed to work.

The way vst3 does it is to notify the plugin each time the system DPI changes. For single monitor setups that's not a big deal, but for multiple monitors with different DPI scaling on each one I think it's definately valuable. Prevents the user from having the close and reopen the plugin gui when dragging between monitors. Would it be possible to add this feature?

sjoerdk-of avatar Mar 24 '24 15:03 sjoerdk-of

Shouldn't this be handled by calling set_scale() again, when the window API changes the underlying resolution of its canvas/whatever?

APIs like Cocoa shouldn't use .set_scale() anyway (since they work in logical pixels), and I'd expect those to have some way for you to listen yourself (e.g. I found NSViewLayerContentScaleDelegate, although it's not immediately obvious how you'd hook it up)

geraintluff avatar Jul 16 '25 14:07 geraintluff

I agree with @geraintluff - hosts should call set_scale whenever they need.

baconpaul avatar Jul 17 '25 00:07 baconpaul

Vote to close, since if hosts aren't calling .set_scale(), that's not a CLAP standard issue?

geraintluff avatar Jul 17 '25 11:07 geraintluff

I would close it once we add to the comments that hosts can call set scale on running plugins again if dpi changes hrs

baconpaul avatar Jul 17 '25 11:07 baconpaul