Skip to content

Fix SetWindowSize bug on Retina display#5706

Open
JoeStrout wants to merge 1 commit intoraysan5:masterfrom
JoeStrout:fix-setwindowsize
Open

Fix SetWindowSize bug on Retina display#5706
JoeStrout wants to merge 1 commit intoraysan5:masterfrom
JoeStrout:fix-setwindowsize

Conversation

@JoeStrout
Copy link
Copy Markdown
Contributor

I ran into the following issue (on MacOS):

  1. On app startup, I call SetWindowSize 800,600. I then enter my usual drawing loop.
  2. If I launch this on the external display, it works fine. But if I launch it on the Retina display, it's blank. Even if my drawing loop is nothing but ClearBackground and DrawFPS (between Begin/EndDrawing of course), all I see is the background color — no FPS.
  3. If I drag the window over to my external monitor, suddenly I see all the content (FPS and any other drawing).
  4. If I then drag it back to the retina display, I still see the correct content.

The issue seemed to be that SetWindowSize updated CORE.Window.screen but not CORE.Window.render (and moving the window to another display caused the render to update, thus "fixing" the issue).

This PR adds code to update the render right away. Now my resized windows correctly show their rendering, even on a retina display. Tested both with and without the FLAG_WINDOW_HIDPI flag.

resizing the window on a retina display.
@JoeStrout JoeStrout changed the title Fix setwindowsize Fix SetWindowSize bug on Retina display Mar 29, 2026
@JoeStrout
Copy link
Copy Markdown
Contributor Author

NOTE: the actual fix was coded by Claude Opus 4.6.

@raysan5
Copy link
Copy Markdown
Owner

raysan5 commented Mar 29, 2026

@JoeStrout Note that GLFW manages multiple platforms, did you test those changes on Windows, Linux X11, Linux Wayland and HTML5? Did you test those changes on multiple monitors configuration with different DPIs?

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