Skip to content

Conversation

azhuchkov
Copy link

@azhuchkov azhuchkov commented Aug 5, 2025

Motivation

This update resolves a backward compatibility issue introduced in Pyglet 2.1, where the new default DPI settings may lead to incorrect window sizing and positioning on HiDPI displays. (Pyglet 2.1 is automatically used as a default backend in moderngl_window)

Proposed Changes

  • A “Troubleshooting” section in README.md that documents the new PYGLET_DPI_SCALING environment variable. Users can set it to scaled or stretch to restore expected behavior.
  • Support code in manimlib/window.py to read PYGLET_DPI_SCALING at startup and apply it to pyglet.options.dpi_scaling (if available). A stderr warning is emitted when running against older Pyglet versions that lack this option.

This should allow to restore prior DPI behavior without requiring a downgrade or switching default value, which requires rigorous testing.

@azhuchkov
Copy link
Author

Link to the introduction of the new DPI scaling feature.

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