You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In consequence ImGui_ImplWin32_GetDpiScaleForMonitor() fails to provide monitor dependent scaling as the monitor handler is ignored for versions below 8.1, see
ImGui_ImplWin32_GetDpiScaleForMonitor()
{
// if not win8.1 or higher:
const HDC dc = ::GetDC(NULL); // <- this is not monitor specific
xdpi = ::GetDeviceCaps(dc, LOGPIXELSX);
ydpi = ::GetDeviceCaps(dc, LOGPIXELSY);
}
This issue has been debated and fixed here:
#glfw/glfw#1294
For ImGui_ImplWin32_EnableDpiAwareness() we had already caved in and ignored the IsWindows10OrGreater() version check for the same reason. Instead we just check the availability of function in the DLL. (note that it was intuitively elmindreda's first intuition in IsWindows8Point1OrGreater fails on Windows 10 glfw/glfw#1294 (comment) before RtlGetVersion got mentioned). I think it may be a viable route to simply do that...
That path in ImGui_ImplWin32_GetDpiScaleForMonitor() would lead to call GetProcAddress() every frame on every monitor which is properly not ideal, so that's something we can fix as well.
I have now applied your suggestion with b66529f (+ improved ImGui_ImplWin32_GetDpiScaleForMonitor() as well).
- Backends: Win32: Rework to handle certains Windows 8.1/10 features without a manifest. (#4200, #4191)
- ImGui_ImplWin32_GetDpiScaleForMonitor() will handle per-monitor DPI on Windows 10 without a manifest.
- ImGui_ImplWin32_EnableDpiAwareness() will call SetProcessDpiAwareness() fallback on Windows 8.1 without a manifest.
Hi,
This is related to multi DPI support.
IsWindows8Point1OrGreater() will return false on win8.1 or win10 is no manifest file exists:
https://docs.microsoft.com/en-us/windows/win32/api/versionhelpers/nf-versionhelpers-iswindows8point1orgreater
In consequence ImGui_ImplWin32_GetDpiScaleForMonitor() fails to provide monitor dependent scaling as the monitor handler is ignored for versions below 8.1, see
This issue has been debated and fixed here:
#glfw/glfw#1294
My fix is mostly based on:
glfw/glfw@83aefa9
https://github.com/glfw/glfw/blob/061a0263a9783c1442ad96a061c717c167ab4a76/src/win32_platform.h
In file imgui_impl_win32.cpp replace function IsWindowsVersionOrGreater() with:
and remove the last argument from the three IsWindowsVersionOrGreater() calls:
The text was updated successfully, but these errors were encountered: