2
0
Эх сурвалжийг харах

X11: Fix segfault on Cygwin/X RandR 1.5

Camilla Löwy 8 жил өмнө
parent
commit
77eb94409c
2 өөрчлөгдсөн 10 нэмэгдсэн , 0 устгасан
  1. 1 0
      README.md
  2. 9 0
      src/x11_init.c

+ 1 - 0
README.md

@@ -123,6 +123,7 @@ information on what to include when reporting a bug.
 - [Win32] Bugfix: Deadzone logic could underflow with some controllers (#910)
 - [Win32] Bugfix: Deadzone logic could underflow with some controllers (#910)
 - [Win32] Bugfix: Bitness test in `FindVulkan.cmake` was VS specific (#928)
 - [Win32] Bugfix: Bitness test in `FindVulkan.cmake` was VS specific (#928)
 - [X11] Replaced `_GLFW_HAS_XF86VM` compile-time option with dynamic loading
 - [X11] Replaced `_GLFW_HAS_XF86VM` compile-time option with dynamic loading
+- [X11] Bugfix: `glfwGetVideoMode` would segfault on Cygwin/X
 - [Cocoa] Added support for Vulkan window surface creation via
 - [Cocoa] Added support for Vulkan window surface creation via
           [MoltenVK](https://moltengl.com/moltenvk/) (#870)
           [MoltenVK](https://moltengl.com/moltenvk/) (#870)
 - [Cocoa] Bugfix: Disabling window aspect ratio would assert (#852)
 - [Cocoa] Bugfix: Disabling window aspect ratio would assert (#852)

+ 9 - 0
src/x11_init.c

@@ -513,6 +513,15 @@ static GLFWbool initExtensions(void)
             _glfw.x11.randr.gammaBroken = GLFW_TRUE;
             _glfw.x11.randr.gammaBroken = GLFW_TRUE;
         }
         }
 
 
+        if (!sr->ncrtc || !sr->noutput || !sr->nmode)
+        {
+            // This is either a headless system or broken Cygwin/X RandR
+            // Flag it as useless and fall back to Xlib display functions
+            _glfwInputError(GLFW_PLATFORM_ERROR,
+                            "X11: RandR monitor support seems broken");
+            _glfw.x11.randr.monitorBroken = GLFW_TRUE;
+        }
+
         XRRFreeScreenResources(sr);
         XRRFreeScreenResources(sr);
 
 
         XRRSelectInput(_glfw.x11.display, _glfw.x11.root,
         XRRSelectInput(_glfw.x11.display, _glfw.x11.root,