From cd0dc76c7c979fdec0b7b3721e3a91de7a730d0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Wed, 19 Aug 2020 19:30:00 +0200 Subject: [PATCH] Null: Fix out parameters not being set It turns out platform functions are sometimes called directly instead of going through the public wrapper. --- src/null_monitor.c | 4 ++++ src/null_window.c | 23 +++++++++++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/null_monitor.c b/src/null_monitor.c index 2590c84e..8301eb3a 100644 --- a/src/null_monitor.c +++ b/src/null_monitor.c @@ -72,6 +72,10 @@ void _glfwPlatformFreeMonitor(_GLFWmonitor* monitor) void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos) { + if (xpos) + *xpos = 0; + if (ypos) + *ypos = 0; } void _glfwPlatformGetMonitorContentScale(_GLFWmonitor* monitor, diff --git a/src/null_window.c b/src/null_window.c index 61a17da7..3e446641 100644 --- a/src/null_window.c +++ b/src/null_window.c @@ -269,10 +269,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; } }