Skip to content
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

Fix window not initializing on primary monitor on GLFW backend #3923

Merged
merged 1 commit into from
Apr 19, 2024
Merged

Fix window not initializing on primary monitor on GLFW backend #3923

merged 1 commit into from
Apr 19, 2024

Conversation

eldskald
Copy link
Contributor

The way the current code worked was by calling GetCurrentMonitor(), which would always return the monitor at position (0,0). This isn't the primary monitor on all platforms, on Linux in particular it isn't the case.

This isn't the case on the SDL backend, after calling InitWindow() the window would always show up on the primary monitor. Even on the GLFW backend, if the full screen flag was set it would attempt to put it on the primary monitor as it would call glfwGetPrimaryMonitor() to do it, so for consistency's sake we should do it on windowed mode too.

The way the current code worked was by calling `GetCurrentMonitor()`,
which would always return the monitor at position (0,0). This isn't the
primary monitor on all platforms, on Linux in particular it isn't the
case.

This isn't the case on the SDL backend, after calling `InitWindow()` the
window would always show up on the primary monitor. Even on the GLFW
backend, if the full screen flag was set it would attempt to put it on
the primary monitor as it would call `glfwGetPrimaryMonitor()` to do it,
so for consistency's sake we should do it on windowed mode too.
@raysan5 raysan5 merged commit 88f7762 into raysan5:master Apr 19, 2024
@raysan5
Copy link
Owner

raysan5 commented Apr 19, 2024

@eldskald thanks for the improvement and the formatting review! 🙂

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