mirror of
https://github.com/ocornut/imgui.git
synced 2025-09-08 04:18:23 +00:00
Backends: SDL2, SDL3, Win32: don't submit monitor with 0 DpiScale (e.g. accessibility virtual monitor?). to prevent assert. (#7902)
I am not too confident on this but I believe pushing this is the fastest way we will get feedback.
This commit is contained in:
@@ -848,7 +848,11 @@ static void ImGui_ImplSDL2_UpdateMonitors()
|
||||
// DpiScale to cocoa_window.backingScaleFactor here.
|
||||
float dpi = 0.0f;
|
||||
if (!SDL_GetDisplayDPI(n, &dpi, nullptr, nullptr))
|
||||
{
|
||||
if (dpi <= 0.0f)
|
||||
continue; // Some accessibility applications are declaring virtual monitors with a DPI of 0, see #7902.
|
||||
monitor.DpiScale = dpi / 96.0f;
|
||||
}
|
||||
#endif
|
||||
monitor.PlatformHandle = (void*)(intptr_t)n;
|
||||
platform_io.Monitors.push_back(monitor);
|
||||
|
Reference in New Issue
Block a user