AuburnSounds / Dplug

Make VST2 / VST3 / AU / AAX / CLAP / LV2 / FLP plug-ins for Linux/macOS/Windows, using D.
https://dplug.org/
Other
495 stars 32 forks source link

Windows Hi-DPI support #536

Open p0nce opened 3 years ago

p0nce commented 3 years ago

A complicated issue for sure.

Thing are blurry in non-100% DPI on Windows.

More or less separate from #278. DPI awareness for macOS, Linux and Win32 can be implemented separately.

Lost of useful info here: https://www.enlyze.com/blog/writing-win32-apps-like-its-2020/part-3/

p0nce commented 3 years ago

image

Testing the following hosts:

p0nce commented 3 years ago

Interesting: the window get to know the DPI, but when DPI-aware is free to choose its own size. So there isn't necessarily a need for resizer, when multiple sizes are provided. Will need a declarative flexible way to declare which size interface size are available.

p0nce commented 3 years ago

If resizer is used, it mustn't be on the windowing side, but in the GUIGraphics side. Only the window need to know a "DPI" apparently, but it resize the client area passed to GUIGraphics, who must deal with that size however it wants.

p0nce commented 3 years ago

Apparently we can have Hi-DPI in hosts that don't support it somehow? https://docs.microsoft.com/en-us/windows/win32/hidpi/high-dpi-improvements-for-desktop-applications

p0nce commented 3 years ago

Bitwig wrapper (Bitwig is itself Hi-DPI awareness context v2) doesn't have plugin with DPI awareness, as it seems.

p0nce commented 3 years ago

Waveform get the right DPI in WM_DPICHANGED, however the window is not resized to be larger.

p0nce commented 3 years ago

Test DPI_HOSTING_BEHAVIOR and DPI_AWARENESS_CONTEXT before window creation, and whether the window is stretched in the end :

Conclusion: WM_DPICHANGED never received when changing DPI of a single monitor. Strange.

p0nce commented 3 years ago

IPlug compares the Windows DPI to the monitor DPI to detect DPI change, which could be alright?

p0nce commented 3 years ago

One real problem in Hi-DPI is the shit tier upsampling done by Windows when DPI_AWARENESS_UNAWARE. There is a better GDI upsampling available in Windows 10, hopefully it becomes the default at one point?

p0nce commented 3 years ago
p0nce commented 3 years ago

Blocked until we get more experience getting size changes from host or windowing. For now, increasing sizes will have a positive effect regardless, and most positive in advanced hosts that support Hi-DPI.

p0nce commented 3 years ago

Either we can find a way to create an always-DPI-aware window for plugin view, or it is a futile issue. Popular host open plugin in either hiDPI or not depending on options they remember.

p0nce commented 3 years ago

QA with Hi-DPI screen says it is sharp on Windows (and with the same screen, report problems on macOS) which means the host is Hi-DPI and instantiate DPI-aware plugins where we don't have anything to do. So... much less important than Hi-DPI on macOS.

p0nce commented 3 years ago

VST3 has a way to get the DPI CLAP pushes that