-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
GetWindowDpiScale() result always equals to 1.0 when multi-viewports is disabled #2621
Comments
What do you see in Metrics->Viewports? And if I add You didn't specify the OS. Please note that windows application needs explicit enabling of dpi awareness. |
The OS is Windows 10 x64 and the embedded manifest sets correctly the dpi awareness. My problem is elsewhere. The When the My refined question is do we have to enable the I tested this modification and it works (i.e. I got the correct DPI scale for the main viewport without the With this modification the function (sorry if my justification is not developed enough, I will develop more if necessary tomorrow.) |
You are right, this should be available and working even if multi-viewports are not enabled. |
This should be fixed now, thanks for reporting the issue! |
Version/Branch of Dear ImGui:
Branch: docking (commit 5f409c6)
Back-end/Renderer/Compiler/OS
Back-ends: GLFW 3.3 + sokol engine
My Issue/Question:
My monitor has a DPI scale equals to 1.5. I expected to get this value when using the function
ImGui::GetWindowDpiScale()
. However, it returns the value 1.0. The problem is because theImGuiViewportP::PlatformMonitor
is never set for the main viewport and uses the default value-1
. By setting manually to platform monitor index to 0, I get the good DPI scale.Is it intentional? In the code, the member
ImGuiViewportP::PlatformMonitor
is only updated for owned viewports. Would it be possible to have a public (or internal) API to detect the monitor associated with the main viewport?Some code used to illustrate the problem
The text was updated successfully, but these errors were encountered: