Skip to content

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