Skip to content

Fix double UI scaling on macOS Retina displays - #3087

Open
La1itchauhan wants to merge 2 commits into
AcademySoftwareFoundation:mainfrom
La1itchauhan:fix/macos-double-ui-scaling
Open

La1itchauhan wants to merge 2 commits into
AcademySoftwareFoundation:mainfrom
La1itchauhan:fix/macos-double-ui-scaling

Conversation

@La1itchauhan

Copy link
Copy Markdown

Summary

Fixes #3077

On macOS Retina displays, text in the property panel, main menu, and graph panel title area appears twice as large as intended.

Root Cause

ImGui already compensates for Retina high-DPI displays internally via io.DisplayFramebufferScale. The existing code in Main.cpp additionally reads glfwGetWindowContentScale() and multiplies the font size and style metrics by it, resulting in double scaling.

Fix

Wrap the glfwGetWindowContentScale() query in a platform guard (#if !defined(__APPLE__)) so that it only runs on Windows and X11, where the framebuffer is unscaled and the content scale is the only way to account for DPI. On macOS, deviceScale defaults to 1.0f, allowing ImGui to handle DPI scaling on its own.

Changes

  • source/MaterialXGraphEditor/Main.cpp: Added #if !defined(__APPLE__) guard around the content-scale query block.

Testing

  • Windows / X11: No behavioral change. glfwGetWindowContentScale() continues to provide the DPI multiplier as before.
  • macOS (Retina): deviceScale remains 1.0f, preventing the double scaling. The --uiScale CLI option still works as an additional user-specified multiplier on all platforms.

On macOS, ImGui already compensates for Retina high-DPI displays via io.DisplayFramebufferScale. The existing code additionally reads glfwGetWindowContentScale() and multiplies the font size and style metrics by it, resulting in text that appears twice as large as intended in the property panel, main menu, and graph panel title area.

This fix wraps the content-scale query in a platform guard so that it only runs on Windows and X11, where the framebuffer is unscaled and the content scale is the only way to account for DPI.

Fixes AcademySoftwareFoundation#3077
@linux-foundation-easycla

linux-foundation-easycla Bot commented Sep 19, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: La1itchauhan / name: La1itchauhan (b2879c5)

@jstone-lucasfilm

Copy link
Copy Markdown
Member

Thanks for this proposal, @La1itchauhan! Can you add a comment on the GitHub Issue that you're tackling, so that we can assign it to you? Also, let us know if this contribution is part of ASWF Dev Days, so that we'll know whether to assign the Dev Days 2026 label as well.

@La1itchauhan

Copy link
Copy Markdown
Author

Thanks for the heads up! I've commented on the original issue (#3077) . I'd be happy for this to be counted as part of ASWF Dev Days 2026 please go ahead and add the label

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MaterialX Graph Editor : Double scaling occurs of text (Minor)

2 participants