Skip to content

Conversation

@gaborpapp
Copy link
Contributor

This fixes a DPI/content-scale mismatch in the GLFW backend that caused ImGui and app rendering to shift (and sometimes disappear in fullscreen) during resize. Reproducible in the ImGui sample.

WindowImplGlfw::getContentScale() returned the monitor DPI scale even when high-density framebuffers were disabled. Code using toPixels() (including ImGui) then over-scaled coordinates relative to the actual framebuffer size.

Before the current GLFW rewrite, Window::getContentScale() returned 1.0f for GLFW/Linux, which masked the mismatch.

Fix:
Gate GLFW content scale by the app’s high-density setting:

  • When isHighDensityDisplayEnabled() is false, return 1.0f
  • Otherwise, use glfwGetWindowContentScale() as before

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

Successfully merging this pull request may close these issues.

1 participant