mirror of
https://github.com/brl/mutter.git
synced 2024-11-08 23:16:20 -05: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)
|
||||
{
|
||||
MetaMonitorManagerXrandr *manager_xrandr = META_MONITOR_MANAGER_XRANDR (manager);
|
||||
XRRCrtcGamma gamma;
|
||||
XRRCrtcGamma *gamma;
|
||||
|
||||
gamma.size = size;
|
||||
gamma.red = red;
|
||||
gamma.green = green;
|
||||
gamma.blue = blue;
|
||||
gamma = XRRAllocGamma (size);
|
||||
memcpy (gamma->red, red, sizeof (unsigned short) * size);
|
||||
memcpy (gamma->green, green, sizeof (unsigned short) * size);
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user