|
|
@ -491,24 +491,31 @@ GLFWvidmode* _glfwGetVideoModesX11(_GLFWmonitor* monitor, int* count) |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void _glfwGetVideoModeX11(_GLFWmonitor* monitor, GLFWvidmode* mode) |
|
|
|
GLFWbool _glfwGetVideoModeX11(_GLFWmonitor* monitor, GLFWvidmode* mode) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (_glfw.x11.randr.available && !_glfw.x11.randr.monitorBroken) |
|
|
|
if (_glfw.x11.randr.available && !_glfw.x11.randr.monitorBroken) |
|
|
|
{ |
|
|
|
{ |
|
|
|
XRRScreenResources* sr = |
|
|
|
XRRScreenResources* sr = |
|
|
|
XRRGetScreenResourcesCurrent(_glfw.x11.display, _glfw.x11.root); |
|
|
|
XRRGetScreenResourcesCurrent(_glfw.x11.display, _glfw.x11.root); |
|
|
|
XRRCrtcInfo* ci = XRRGetCrtcInfo(_glfw.x11.display, sr, monitor->x11.crtc); |
|
|
|
const XRRModeInfo* mi = NULL; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
XRRCrtcInfo* ci = XRRGetCrtcInfo(_glfw.x11.display, sr, monitor->x11.crtc); |
|
|
|
if (ci) |
|
|
|
if (ci) |
|
|
|
{ |
|
|
|
{ |
|
|
|
const XRRModeInfo* mi = getModeInfo(sr, ci->mode); |
|
|
|
mi = getModeInfo(sr, ci->mode); |
|
|
|
if (mi) // mi can be NULL if the monitor has been disconnected
|
|
|
|
if (mi) |
|
|
|
*mode = vidmodeFromModeInfo(mi, ci); |
|
|
|
*mode = vidmodeFromModeInfo(mi, ci); |
|
|
|
|
|
|
|
|
|
|
|
XRRFreeCrtcInfo(ci); |
|
|
|
XRRFreeCrtcInfo(ci); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
XRRFreeScreenResources(sr); |
|
|
|
XRRFreeScreenResources(sr); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!mi) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
_glfwInputError(GLFW_PLATFORM_ERROR, "X11: Failed to query video mode"); |
|
|
|
|
|
|
|
return GLFW_FALSE; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
@ -519,6 +526,8 @@ void _glfwGetVideoModeX11(_GLFWmonitor* monitor, GLFWvidmode* mode) |
|
|
|
_glfwSplitBPP(DefaultDepth(_glfw.x11.display, _glfw.x11.screen), |
|
|
|
_glfwSplitBPP(DefaultDepth(_glfw.x11.display, _glfw.x11.screen), |
|
|
|
&mode->redBits, &mode->greenBits, &mode->blueBits); |
|
|
|
&mode->redBits, &mode->greenBits, &mode->blueBits); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return GLFW_TRUE; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
GLFWbool _glfwGetGammaRampX11(_GLFWmonitor* monitor, GLFWgammaramp* ramp) |
|
|
|
GLFWbool _glfwGetGammaRampX11(_GLFWmonitor* monitor, GLFWgammaramp* ramp) |
|
|
|