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

@andrewfb
Copy link
Collaborator

andrewfb commented Feb 3, 2026

This seems right to me - I'd be inclined to merge as-is

@andrewfb andrewfb merged commit 48b16b7 into cinder:master Feb 11, 2026
8 checks passed
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.

2 participants