AuburnSounds / AuburnSounds/Dplug

Windows Hi-DPI support

Open
#536 15 comments 0 reactions 0 assignees View on GitHub
Enhancement Super hard Windows
Dominant language
D
Stars
564
Forks
34
PR merge metrics
No merged PRs in 30d

Description

**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/

- [x] Adjust size with `AdjustWindowRectExForDpi` if available => no need it seems
- [x] handle WM_SIZE => no need
- [x] handle WM_DPICHANGED for awareness v2 => OK, but doesn't get right DPI in Bitwig, need to force thread-awareness if possible. (EDIT: was a bad idea)
- [x] handle WM_GETDPISCALEDSIZE and test with Per Monitor v2 awareness host => no need it seems
- [x] scale mouse movement by DPI? => don't think it's useful.
- [ ] IWindowListener should have new interface call: `getSizeOfWindow(float dpi, out int width, out int height)`
The default size is returned with DPI 100% aka `1.0f`. The window constructor is not given a size in pixels anymore.
- [x] Ability to create the window in a Hi-DPI context with save/restore of the thread DPI-awareness around the CreateWindow => this doesn't seem to work that well?

Contributor guide

Open the contributing guide

Research direction

Start with the linked Win32 Hi-DPI article and the unchecked IWindowListener interface change, then trace the window constructor and CreateWindow handling. Check how WM_DPICHANGED and thread DPI awareness behave for non-100% Windows scaling. Done means windows and their contents are rendered and sized correctly at non-100% DPI without breaking other platforms.

Written by the indexing model from the issue text.

Assessment

Domain
desktop, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.