diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 110ed4cd..d1257532 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -260,6 +260,7 @@ video tutorials. - Jonas Ådahl - Lasse Öörni - Leonard König + - comp500 - All the unmentioned and anonymous contributors in the GLFW community, for bug reports, patches, feedback, testing and encouragement diff --git a/README.md b/README.md index 8b4a1546..4d0fec02 100644 --- a/README.md +++ b/README.md @@ -229,6 +229,7 @@ information on what to include when reporting a bug. - [Win32] Bugfix: Instance-local operations used executable instance (#469,#1296,#1395) - [Win32] Bugfix: The OSMesa library was not unloaded on termination - [Win32] Bugfix: Right shift emitted `GLFW_KEY_UNKNOWN` when using a CJK IME (#2050) + - [Win32] Bugfix: GLFW refuses to go fullscreen with custom resolution refresh rate (#1904) - [Cocoa] Added support for `VK_EXT_metal_surface` (#1619) - [Cocoa] Added locating the Vulkan loader at runtime in an application bundle - [Cocoa] Moved main menu creation to GLFW initialization time (#1649) diff --git a/src/win32_monitor.c b/src/win32_monitor.c index 2935ac28..2a4bdc49 100644 --- a/src/win32_monitor.c +++ b/src/win32_monitor.c @@ -397,10 +397,13 @@ void _glfwGetMonitorWorkareaWin32(_GLFWmonitor* monitor, GLFWvidmode* _glfwGetVideoModesWin32(_GLFWmonitor* monitor, int* count) { - int modeIndex = 0, size = 0; + int modeIndex = 0, size = 1; GLFWvidmode* result = NULL; - *count = 0; + *count = 1; + // HACK: Always return the current video mode + result = _glfw_calloc(1, sizeof(GLFWvidmode)); + _glfwGetVideoModeWin32(monitor, result); for (;;) { @@ -461,14 +464,6 @@ GLFWvidmode* _glfwGetVideoModesWin32(_GLFWmonitor* monitor, int* count) result[*count - 1] = mode; } - if (!*count) - { - // HACK: Report the current mode if no valid modes were found - result = _glfw_calloc(1, sizeof(GLFWvidmode)); - _glfwGetVideoModeWin32(monitor, result); - *count = 1; - } - return result; }