diff --git a/README.md b/README.md index b62ff742..1e99e990 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,8 @@ used by the tests and examples and are not required to build the library. - Relaxed rules for native access header macros - Removed dependency on external OpenGL or OpenGL ES headers - [Win32] Added support for Windows 8.1 per-monitor DPI + - [Win32] Bugfix: Window creation would segfault if video mode setting required + the system to be restarted - [Cocoa] Removed support for OS X 10.6 - [Cocoa] Bugfix: Full screen windows on secondary monitors were mispositioned - [X11] Bugfix: Monitor connection and disconnection events were not reported diff --git a/src/win32_monitor.c b/src/win32_monitor.c index 0ad1b7a4..2cafe6d8 100644 --- a/src/win32_monitor.c +++ b/src/win32_monitor.c @@ -278,6 +278,14 @@ GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* count) result[*count - 1] = mode; } + if (!*count) + { + // HACK: Report the current mode if no valid modes were found + result = calloc(1, sizeof(GLFWvidmode)); + _glfwPlatformVideoMode(monitor, result); + *count = 1; + } + return result; }