diff --git a/include/GLFW/glfw3.h b/include/GLFW/glfw3.h index 1aae0a55..6ef01bf9 100644 --- a/include/GLFW/glfw3.h +++ b/include/GLFW/glfw3.h @@ -3903,6 +3903,8 @@ GLFWAPI void glfwRequestWindowAttention(GLFWwindow* window); * The window should not be NULL. * * @param[in] window The window to query. + * @return The monitor, or `NULL` if the window is NULL or an + * [error](@ref error_handling) occurred. * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * diff --git a/src/win32_window.c b/src/win32_window.c index 55d0ab9c..f81999a2 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -1772,7 +1772,7 @@ _GLFWmonitor* _glfwGetMonitorDisplayingWindowWin32(_GLFWwindow* window) return _glfw.monitors[i]; } - return _glfw.monitors[0]; + return NULL; } void _glfwFocusWindowWin32(_GLFWwindow* window)