mirror of
https://github.com/glfw/glfw.git
synced 2024-11-25 22:14:34 +00:00
X11: Add validation of RandR gamma ramp size
This commit is contained in:
parent
2226e60944
commit
66b16f1fc1
@ -175,6 +175,7 @@ information on what to include when reporting a bug.
|
|||||||
- [X11] Bugfix: XDND support had multiple non-conformance issues (#968)
|
- [X11] Bugfix: XDND support had multiple non-conformance issues (#968)
|
||||||
- [X11] Bugfix: The RandR monitor path was disabled despite working RandR (#972)
|
- [X11] Bugfix: The RandR monitor path was disabled despite working RandR (#972)
|
||||||
- [X11] Bugfix: IM-duplicated key events would leak at low polling rates (#747)
|
- [X11] Bugfix: IM-duplicated key events would leak at low polling rates (#747)
|
||||||
|
- [X11] Bugfix: Gamma ramp setting via RandR did not validate ramp size
|
||||||
- [Linux] Bugfix: Event processing did not detect joystick disconnection (#932)
|
- [Linux] Bugfix: Event processing did not detect joystick disconnection (#932)
|
||||||
- [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)
|
||||||
|
@ -453,6 +453,13 @@ void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp)
|
|||||||
{
|
{
|
||||||
if (_glfw.x11.randr.available && !_glfw.x11.randr.gammaBroken)
|
if (_glfw.x11.randr.available && !_glfw.x11.randr.gammaBroken)
|
||||||
{
|
{
|
||||||
|
if (XRRGetCrtcGammaSize(_glfw.x11.display, monitor->x11.crtc) != ramp->size)
|
||||||
|
{
|
||||||
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
|
"X11: Gamma ramp size must match current ramp size");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
XRRCrtcGamma* gamma = XRRAllocGamma(ramp->size);
|
XRRCrtcGamma* gamma = XRRAllocGamma(ramp->size);
|
||||||
|
|
||||||
memcpy(gamma->red, ramp->red, ramp->size * sizeof(unsigned short));
|
memcpy(gamma->red, ramp->red, ramp->size * sizeof(unsigned short));
|
||||||
|
Loading…
Reference in New Issue
Block a user