From e8d8ced00680d9fdbf9617d2306a22311ad2bfd6 Mon Sep 17 00:00:00 2001 From: Luflosi Date: Mon, 7 Sep 2020 20:51:21 +0200 Subject: [PATCH] GLFW: Null: Fix out parameters not being set From upstream: https://github.com/glfw/glfw/commit/cd0dc76c7c979fdec0b7b3721e3a91de7a730d0d. --- glfw/null_monitor.c | 6 +++++- glfw/null_window.c | 23 +++++++++++++++++++---- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/glfw/null_monitor.c b/glfw/null_monitor.c index efd132da5..6801352b8 100644 --- a/glfw/null_monitor.c +++ b/glfw/null_monitor.c @@ -70,8 +70,12 @@ void _glfwPlatformFreeMonitor(_GLFWmonitor* monitor) _glfwFreeGammaArrays(&monitor->null.ramp); } -void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor UNUSED, int* xpos UNUSED, int* ypos UNUSED) +void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor UNUSED, int* xpos, int* ypos) { + if (xpos) + *xpos = 0; + if (ypos) + *ypos = 0; } void _glfwPlatformGetMonitorContentScale(_GLFWmonitor* monitor UNUSED, diff --git a/glfw/null_window.c b/glfw/null_window.c index 564b19a43..bf2fdd859 100644 --- a/glfw/null_window.c +++ b/glfw/null_window.c @@ -274,10 +274,25 @@ void _glfwPlatformGetWindowFrameSize(_GLFWwindow* window, { if (window->null.decorated && !window->monitor) { - *left = 1; - *top = 10; - *right = 1; - *bottom = 1; + if (left) + *left = 1; + if (top) + *top = 10; + if (right) + *right = 1; + if (bottom) + *bottom = 1; + } + else + { + if (left) + *left = 0; + if (top) + *top = 0; + if (right) + *right = 0; + if (bottom) + *bottom = 0; } }