From 03ea87ea287a7391603bcf85a441412d973f65f1 Mon Sep 17 00:00:00 2001 From: Chris Savoie Date: Fri, 8 May 2020 13:02:15 -0700 Subject: [PATCH] Backends, Win32: Request monitor update when dpi awarness is enabled to make sure they have the correct dpi settings. --- examples/imgui_impl_win32.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/imgui_impl_win32.cpp b/examples/imgui_impl_win32.cpp index b7a38785..207e54fe 100644 --- a/examples/imgui_impl_win32.cpp +++ b/examples/imgui_impl_win32.cpp @@ -473,6 +473,9 @@ typedef DPI_AWARENESS_CONTEXT(WINAPI* PFN_SetThreadDpiAwarenessContext)(DPI_AWAR // Helper function to enable DPI awareness without setting up a manifest void ImGui_ImplWin32_EnableDpiAwareness() { + // Make sure monitors will be updated with latest correct scaling + g_WantUpdateMonitors = true; + // if (IsWindows10OrGreater()) // This needs a manifest to succeed. Instead we try to grab the function pointer! { static HINSTANCE user32_dll = ::LoadLibraryA("user32.dll"); // Reference counted per-process