|
@@ -962,14 +962,10 @@ static void ImGui_ImplGlfw_UpdateMonitors()
|
|
monitor.WorkSize = ImVec2((float)w, (float)h);
|
|
monitor.WorkSize = ImVec2((float)w, (float)h);
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
-#if GLFW_HAS_PER_MONITOR_DPI
|
|
|
|
- // Warning: the validity of monitor DPI information on Windows depends on the application DPI awareness settings, which generally needs to be set in the manifest or at runtime.
|
|
|
|
- float x_scale, y_scale;
|
|
|
|
- glfwGetMonitorContentScale(glfw_monitors[n], &x_scale, &y_scale);
|
|
|
|
- if (x_scale == 0.0f)
|
|
|
|
|
|
+ float scale = ImGui_ImplGlfw_GetContentScaleForMonitor(glfw_monitors[n]);
|
|
|
|
+ if (scale == 0.0f)
|
|
continue; // Some accessibility applications are declaring virtual monitors with a DPI of 0, see #7902.
|
|
continue; // Some accessibility applications are declaring virtual monitors with a DPI of 0, see #7902.
|
|
- monitor.DpiScale = x_scale;
|
|
|
|
-#endif
|
|
|
|
|
|
+ monitor.DpiScale = scale;
|
|
monitor.PlatformHandle = (void*)glfw_monitors[n]; // [...] GLFW doc states: "guaranteed to be valid only until the monitor configuration changes"
|
|
monitor.PlatformHandle = (void*)glfw_monitors[n]; // [...] GLFW doc states: "guaranteed to be valid only until the monitor configuration changes"
|
|
platform_io.Monitors.push_back(monitor);
|
|
platform_io.Monitors.push_back(monitor);
|
|
}
|
|
}
|