-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[rcore][desktop_glfw] Keeping CORE.Window.position properly in sync with glfw window position #4190
Conversation
CORE.Window.position is now properly kept in sync with the glfw window position.
There is a small issue in RayLib 5 when calling ToggleFullscreen() changes the angle Camera3D looks at. (And calling ToggleFullscreen() again changes the angle back). I wonder if this fix fixes that issue as well. |
Comments updated.
@raysan5 @SoloByte With the raylibdll.lib built from https://github.com/SoloByte/raylib/tree/glfw-window-pos-callback the bug with Camera3D angle jumping when switching between resolutions is indeed fixed. I tested it a 3d project. So this PR can be considered as a bug fix, not a just-in-case improvement. The relevant code I tested it with:
|
Thanks for testing this :) I did not think this would fix something else right away ^^ (This PR does fix restoring the window position correctly after exiting fullscreen) I don't know if CORE.Window.position needs to be set initially in InitPlatform() as well. I will look into it before I forget. |
This also fixes not centering the window correctly when the high dpi flag was enabled.
The new commit should set @casperbear You could recheck it, it should not have changed anything (hopefully). I have tested it both on windows 11 & macOS with both high dpi flag enabled & disabled. |
Here the render size has to be used again in case the high dpi flag is enabled.
Update Window Position right away in ToggleFullscreen() & ToggleBorderlessWindowed() functions
@SoloByte The improvement looks good to me, thanks for the review and sorry for the late review. |
Thanks, and no worries because of the delay :) |
CORE.Window.position is now properly kept in sync with the glfw window position.
Those changes should not change any behavior other than fixing
ToggleFullscreen()
not restoring the window to the correct previous window position.FYI: There will be another PR for fixing the remaining problems with fullscreen & borderless fullscreen