1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-02-08 04:40:09 +00:00

Do not use the manifest setting as it prevents setting DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2

The manifest has dpiAware set to True/PM (PerMonitor) and won't allow a change to PerMonitorV2 afterwards.

https://learn.microsoft.com/en-us/windows/win32/hidpi/setting-the-default-dpi-awareness-for-a-process
This commit is contained in:
LunarInvasion 2025-11-20 15:48:10 +00:00
parent 10fca0e8b1
commit 4e88d1d589
2 changed files with 9 additions and 5 deletions

View file

@ -37,7 +37,7 @@ int main(int, char**)
{
// Make process DPI aware and obtain main monitor scale
// https://learn.microsoft.com/en-us/windows/win32/hidpi/setting-the-default-dpi-awareness-for-a-process
// ImGui_ImplWin32_EnableDpiAwareness(); // This is already set in the manifest so the call will fail, but leaving it for completeness.
ImGui_ImplWin32_EnableDpiAwareness();
float main_scale = ImGui_ImplWin32_GetDpiScaleForMonitor(::MonitorFromPoint(POINT{ 0, 0 }, MONITOR_DEFAULTTOPRIMARY));
// Create application window