[rcore][GLFW] REVIEWED: SetWindowSize(), scaling issues on Retina display#5706
[rcore][GLFW] REVIEWED: SetWindowSize(), scaling issues on Retina display#5706JoeStrout wants to merge 1 commit into
SetWindowSize(), scaling issues on Retina display#5706Conversation
resizing the window on a retina display.
|
NOTE: the actual fix was coded by Claude Opus 4.6. |
|
@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? |
|
Tested on Windows 7 with below scenario. No regression. |
|
I don't have the hardware (or VM setup) to test on anything other than Mac. But on Mac, I did test with multiple monitors with different DPIs. |
|
Hi there, tested it on Debian |
SetWindowSize(), scaling issues on Retina display
|
I now think the fix is incomplete. With this fix, my drawing appears, which is an improvement (before, the window remained stubbornly blank). But everything appears twice as big (and far from the origin) as it should, and I'm so far unable to fix this by adjusting the zoom via BeginMode2D. I'm hampered by poor understanding of how Raylib is supposed to work on a HDPI window. In the absence of camera shenanigans, are all drawing and mouse coordinates supposed to be in (high-density) pixels, or (72dpi-ish) logical points? |
|
It appears that the real problem was just an error on my end; I failed to call I'm closing this PR, and I apologize for wasting everyone's time. I'll be more thorough next time I think I've found a bug! |



I ran into the following issue (on MacOS):
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.