[core] GetCurrentMonitor()
detection inconsistency issue for PLATFORM_DESKTOP
#3213
Closed
4 tasks done
Issue description
The current implementation of
GetCurrentMonitor()
(rcore.c#L1801) uses the workarea dimensions (rcore.c#L1842) for checking which is the current monitor while not on fullscreen mode.The problem of using workarea for monitor detection is that it's (usually) a smaller area than the actual monitor dimension. While the workarea is a good solution for window placement, it becomes a problem for monitor detection, since if the window is larger than the workarea (e.g.:
windowWidth = monitorWidth; windowHeight = monitorHeight;
) it will end up outside the workarea limits, causing it to be detected as inside the wrong monitor.Proposed solution
This can be fixed by changing
glfwGetMonitorWorkarea()
byglfwGetMonitorPos()
andglfwGetVideoMode()
onGetCurrentMonitor()
.I'll send a PR with the proposed fix shortly.
Environment
Platform: Desktop
Operating System: Linux Mint 21.1 (x86_64)
OpenGL version: 3.1 Mesa 22.0.5
GPU: Intel HD Graphics 3000
Code Example
Minimal reproduction code to test the issue:
The text was updated successfully, but these errors were encountered: