What?
Blender currently does not support “per monitor DPI scaling”. This is a feature introduced in Windows 8.1 that allows users to assign different logical DPI values to different monitors. This is useful when the user has multiple monitors with different resolutions and/or physical sizes. (for example: mixing HD and 4k screens, or connecting a 27” monitor to a 15” laptop). Per monitor DPI scaling allows users to choose the most comfortable rendering size on a per monitor basis.
What is the problem?
By default, for legacy reasons, applications are marked as “not per-monitor-dpi compatible”. This makes it so that win32 reports the same DPI value for all monitors. Applications that are moved to a different screen get rendered at the same resolution and then get upscaled/downscaled (depends on which monitor is the main monitor) by Windows. This results in a visibly blurry low-quality image.
Blender without the patch:
| 4K monitor as main, Blender on 4K screen | 4K monitor as main, Blender on HD screen | HD monitor as main, Blender on 4K screen | HD monitor as main, Blender on HD screen | |
How to fix this?
By calling SetProcessDpiAwareness an application can mark itself a per-monitor-DPI aware. This makes it so that its windows receive a dpi-change message when they are moved to a different monitor. The application can then redraw its window contents at the new, correct DPI. This results in a clear, sharp image.
What does this patch do?
This patch modifies the GHOST library to mark Blender as “per-monitor-dpi aware” for Windows. A function “getDPIHint” is added to the GHOST window classes that returns the DPI setting recommended by the operating system. Furthermore, a new event “GHOST_kEventWindowDPIHintChanged” is introduced to signal a change in the system recommended DPI (for example: a window is moved to a different monitor).
An implementation for getDPIHint is also provided for X11 and SDL, which makes Blender responsive to system DPI scaling on those platforms. For X11, the Xft.dpi setting is used if present, otherwise the DPI is identical to the one set using “xrandr --dpi”. On SDL “SDL_GetDisplayDPI” is used.
The patch adds two user preferences: use_system_dpi and dpi_multiplier.
The first specifies whether or not the user wants to use the dpi returned by getDPIHint.
The second specifies a scaling factor that is used on getDPIHint before using it.
Blender with the patch:
| 4K monitor as main, Blender on 4K screen | 4K monitor as main, Blender on HD screen | HD monitor as main, Blender on 4K screen | HD monitor as main, Blender on HD screen |
Extra info:
https://msdn.microsoft.com/en-us/library/windows/desktop/dd464646(v=vs.85).aspx
https://wiki.archlinux.org/index.php/HiDPI
https://wiki.libsdl.org/SDL_GetDisplayDPI








