Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GLFW may retrieve bad DPI scaling data for the UI #1242

Closed
kiroma opened this issue Dec 3, 2024 · 3 comments
Closed

GLFW may retrieve bad DPI scaling data for the UI #1242

kiroma opened this issue Dec 3, 2024 · 3 comments

Comments

@kiroma
Copy link

kiroma commented Dec 3, 2024

I've stumbled upon an interesting issue on my laptop. For every sample in the repository, no matter how back I checked out the samples, the UI would be either invisible or show up incorrectly.
image
I've traced this issue to GlfwWindow::get_dpi_factor where the call to glfwGetMonitorPhysicalSize incorrectly reported my 16x10 inches screen as 16x10mm, causing the reported DPI to be 4000.
Statically setting the factor to 1 fixes the issue, I've also tested out clamping the factor between 0.5 and 2 and this seems to still allow for interactable UI.

@SaschaWillems
Copy link
Collaborator

Can you check with this PR: #1237 and see if that changes anything?

We use glfw as a submodule and haven't updated that in years.

@kiroma
Copy link
Author

kiroma commented Dec 3, 2024

No noticeable difference, unfortunately.

new screenshot

image

I believe this is simply an issue with the laptop / driver reporting the physical size wrong. If I run xrandr I get the same wrong dimensions as well:

DP-2 connected primary 2560x1600+0+0 (normal left inverted right x axis y axis) 16mm x 10mm

I believe the laptop is trying to report its screen size using inches (as it is a 16 x 10 inch display) but the unit information is lost and thus a bogus value is reported.

@SaschaWillems
Copy link
Collaborator

Should be fine to close then. No chance we can fix a driver bug in our samples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants