mirror of
https://github.com/glfw/glfw.git
synced 2024-11-26 03:52:01 +00:00
Added flag for non-functional RandR monitor path.
This commit is contained in:
parent
13156de8c3
commit
dd02b96c94
@ -49,6 +49,7 @@ The following dependencies are needed by the examples and test programs:
|
||||
- Added `glfwSetDropCallback` and `GLFWdropfun` for receiving dropped files
|
||||
- [Cocoa] Bugfix: Using a 1x1 cursor for hidden mode caused some screen
|
||||
recorders to fail
|
||||
- [X11] Bugfix: The case of finding no usable CRTCs was not detected
|
||||
|
||||
|
||||
## Contact
|
||||
|
@ -62,7 +62,7 @@ static const XRRModeInfo* getModeInfo(const XRRScreenResources* sr, RRMode id)
|
||||
//
|
||||
void _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired)
|
||||
{
|
||||
if (_glfw.x11.randr.available)
|
||||
if (_glfw.x11.randr.available && !_glfw.x11.randr.monitorBroken)
|
||||
{
|
||||
int i, j;
|
||||
XRRScreenResources* sr;
|
||||
@ -136,7 +136,7 @@ void _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired)
|
||||
//
|
||||
void _glfwRestoreVideoMode(_GLFWmonitor* monitor)
|
||||
{
|
||||
if (_glfw.x11.randr.available)
|
||||
if (_glfw.x11.randr.available && !_glfw.x11.randr.monitorBroken)
|
||||
{
|
||||
XRRScreenResources* sr;
|
||||
XRRCrtcInfo* ci;
|
||||
@ -170,13 +170,13 @@ void _glfwRestoreVideoMode(_GLFWmonitor* monitor)
|
||||
|
||||
_GLFWmonitor** _glfwPlatformGetMonitors(int* count)
|
||||
{
|
||||
int i, found = 0;
|
||||
_GLFWmonitor** monitors = NULL;
|
||||
|
||||
*count = 0;
|
||||
|
||||
if (_glfw.x11.randr.available)
|
||||
{
|
||||
int i, found = 0;
|
||||
RROutput primary;
|
||||
XRRScreenResources* sr;
|
||||
|
||||
@ -245,13 +245,16 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
|
||||
|
||||
if (found == 0)
|
||||
{
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||
"X11: RandR monitor support seems broken");
|
||||
_glfw.x11.randr.monitorBroken = GL_TRUE;
|
||||
|
||||
free(monitors);
|
||||
monitors = NULL;
|
||||
}
|
||||
|
||||
*count = found;
|
||||
}
|
||||
else
|
||||
|
||||
if (!monitors)
|
||||
{
|
||||
monitors = calloc(1, sizeof(_GLFWmonitor*));
|
||||
monitors[0] = _glfwAllocMonitor("Display",
|
||||
@ -259,9 +262,10 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
|
||||
_glfw.x11.screen),
|
||||
DisplayHeightMM(_glfw.x11.display,
|
||||
_glfw.x11.screen));
|
||||
*count = 1;
|
||||
found = 1;
|
||||
}
|
||||
|
||||
*count = found;
|
||||
return monitors;
|
||||
}
|
||||
|
||||
@ -272,7 +276,7 @@ GLboolean _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second)
|
||||
|
||||
void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos)
|
||||
{
|
||||
if (_glfw.x11.randr.available)
|
||||
if (_glfw.x11.randr.available && !_glfw.x11.randr.monitorBroken)
|
||||
{
|
||||
XRRScreenResources* sr;
|
||||
XRRCrtcInfo* ci;
|
||||
@ -309,7 +313,7 @@ GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found)
|
||||
|
||||
// Build array of available resolutions
|
||||
|
||||
if (_glfw.x11.randr.available)
|
||||
if (_glfw.x11.randr.available && !_glfw.x11.randr.monitorBroken)
|
||||
{
|
||||
int i, j;
|
||||
XRRScreenResources* sr;
|
||||
@ -375,7 +379,7 @@ GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found)
|
||||
|
||||
void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode* mode)
|
||||
{
|
||||
if (_glfw.x11.randr.available)
|
||||
if (_glfw.x11.randr.available && !_glfw.x11.randr.monitorBroken)
|
||||
{
|
||||
XRRScreenResources* sr;
|
||||
XRRCrtcInfo* ci;
|
||||
|
@ -164,6 +164,7 @@ typedef struct _GLFWlibraryX11
|
||||
int versionMajor;
|
||||
int versionMinor;
|
||||
GLboolean gammaBroken;
|
||||
GLboolean monitorBroken;
|
||||
} randr;
|
||||
|
||||
struct {
|
||||
|
Loading…
Reference in New Issue
Block a user