Skip to content

Normalize SDL3 HiDPI window scaling across platforms#141

Closed
kunitoki with Copilot wants to merge 4 commits into
mainfrom
copilot/consolidate-dpi-handling
Closed

Normalize SDL3 HiDPI window scaling across platforms#141
kunitoki with Copilot wants to merge 4 commits into
mainfrom
copilot/consolidate-dpi-handling

Conversation

Copilot AI commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

SDL3 windows on Windows HiDPI displays used a fixed 1.0 scale, making fonts and widgets undersized. Resize handling also conflated logical window dimensions with physical framebuffer dimensions.

  • Per-window DPI

    • Use SDL_GetWindowDisplayScale() for high-density windows on all platforms.
    • Refresh scaling when windows move between displays.
  • Resize semantics

    • Apply SDL_EVENT_WINDOW_RESIZED to logical component bounds.
    • Treat SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED as a framebuffer repaint/renderer update only.
  • Display bookkeeping

    • Rebuild the screen list on display updates instead of accumulating duplicates.
const auto scale = SDL_GetWindowDisplayScale (window);
return scale > 0.0f ? scale : 1.0f;

@kunitoki kunitoki closed this Jul 15, 2026
@kunitoki kunitoki deleted the copilot/consolidate-dpi-handling branch July 15, 2026 05:41
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