mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 11:32:04 +00:00
MonitorXrandr: fix setting gamma ramps
The value passed to XRRCrtcSetGamma must be allocated with XRRAllocGamma (because it relies on the locations of green and blue), otherwise garbage is sent on the wire. https://bugzilla.gnome.org/show_bug.cgi?id=706231
This commit is contained in:
parent
8ad5ccd2f8
commit
015c05fbf6
@ -921,14 +921,16 @@ meta_monitor_manager_xrandr_set_crtc_gamma (MetaMonitorManager *manager,
|
|||||||
unsigned short *blue)
|
unsigned short *blue)
|
||||||
{
|
{
|
||||||
MetaMonitorManagerXrandr *manager_xrandr = META_MONITOR_MANAGER_XRANDR (manager);
|
MetaMonitorManagerXrandr *manager_xrandr = META_MONITOR_MANAGER_XRANDR (manager);
|
||||||
XRRCrtcGamma gamma;
|
XRRCrtcGamma *gamma;
|
||||||
|
|
||||||
gamma.size = size;
|
gamma = XRRAllocGamma (size);
|
||||||
gamma.red = red;
|
memcpy (gamma->red, red, sizeof (unsigned short) * size);
|
||||||
gamma.green = green;
|
memcpy (gamma->green, green, sizeof (unsigned short) * size);
|
||||||
gamma.blue = blue;
|
memcpy (gamma->blue, blue, sizeof (unsigned short) * size);
|
||||||
|
|
||||||
XRRSetCrtcGamma (manager_xrandr->xdisplay, (XID)crtc->crtc_id, &gamma);
|
XRRSetCrtcGamma (manager_xrandr->xdisplay, (XID)crtc->crtc_id, gamma);
|
||||||
|
|
||||||
|
XRRFreeGamma (gamma);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
Loading…
Reference in New Issue
Block a user