summaryrefslogtreecommitdiffhomepage
path: root/src/core.c
diff options
context:
space:
mode:
authorhristo <[email protected]>2020-12-29 14:35:47 +0200
committerGitHub <[email protected]>2020-12-29 13:35:47 +0100
commitd3db690c422862ba785d9f05f44d5e5068088bde (patch)
tree1a7164d5a58f2b6ce625b69ba354148939f00c1a /src/core.c
parentabdd57db0b6b8fdf4ed203e349b74a23f296d4f0 (diff)
downloadraylib-d3db690c422862ba785d9f05f44d5e5068088bde.tar.gz
raylib-d3db690c422862ba785d9f05f44d5e5068088bde.zip
I noticed that toggle fullscreen always gets the primary monitor when its more intuitive to use the monitor that the window is currently in. (#1486)
This monitor should even probably be passed as an id instead to make it more consistent with the rest of the API but this would break existing applications so I am hesitant to change the function signature directly.
Diffstat (limited to 'src/core.c')
-rw-r--r--src/core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core.c b/src/core.c
index e6d27e5f..6fc20eeb 100644
--- a/src/core.c
+++ b/src/core.c
@@ -1025,7 +1025,7 @@ void ToggleFullscreen(void)
// Store previous window position (in case we exit fullscreen)
glfwGetWindowPos(CORE.Window.handle, &CORE.Window.position.x, &CORE.Window.position.y);
- GLFWmonitor *monitor = glfwGetPrimaryMonitor();
+ GLFWmonitor *monitor = glfwGetWindowMonitor(CORE.Window.handle);
if (!monitor)
{
TRACELOG(LOG_WARNING, "GLFW: Failed to get monitor");
@@ -1034,7 +1034,7 @@ void ToggleFullscreen(void)
}
const GLFWvidmode *mode = glfwGetVideoMode(monitor);
- glfwSetWindowMonitor(CORE.Window.handle, glfwGetPrimaryMonitor(), 0, 0, CORE.Window.screen.width, CORE.Window.screen.height, mode->refreshRate);
+ glfwSetWindowMonitor(CORE.Window.handle, monitor, 0, 0, CORE.Window.screen.width, CORE.Window.screen.height, mode->refreshRate);
// Try to enable GPU V-Sync, so frames are limited to screen refresh rate (60Hz -> 60 FPS)
// NOTE: V-Sync can be enabled by graphic driver configuration