diff --git a/gnome-desktop.spec b/gnome-desktop.spec index 020d9dd..7a94ad1 100644 --- a/gnome-desktop.spec +++ b/gnome-desktop.spec @@ -12,10 +12,12 @@ Summary: Shared code among gnome-panel, gnome-session, nautilus, etc Name: gnome-desktop Version: 2.28.1 -Release: 1%{?dist} +Release: 2%{?dist} URL: http://www.gnome.org Source0: http://download.gnome.org/sources/gnome-desktop/2.28/%{name}-%{version}.tar.bz2 Patch1: concatenate-edid-descriptors.patch +# https://bugzilla.gnome.org/show_bug.cgi?id=597874 +Patch2: randr-gamma.patch License: GPLv2+ and LGPLv2+ Group: System Environment/Libraries @@ -75,6 +77,7 @@ libgnomedesktop. %prep %setup -q %patch1 -p1 -b .concatenate-edid-descriptors +%patch2 -p1 -b .randr-gamma %build %configure --with-gnome-distributor="Red Hat, Inc" \ @@ -122,6 +125,9 @@ rm -rf $RPM_BUILD_ROOT %doc %{_datadir}/gtk-doc/html/gnome-desktop/ %changelog +* Thu Oct 22 2009 Matthias Clasen - 2.28.1-2 +- Support proper gamma setting in multihead setups + * Thu Oct 22 2009 Matthias Clasen - 2.28.1-1 - Update to 2.28.1, translation updates diff --git a/randr-gamma.patch b/randr-gamma.patch new file mode 100644 index 0000000..2894a7f --- /dev/null +++ b/randr-gamma.patch @@ -0,0 +1,138 @@ +From 8c052c789b585f434da1e6b92b3f452412074361 Mon Sep 17 00:00:00 2001 +From: Dave Airlie +Date: Thu, 8 Oct 2009 16:09:50 +1000 +Subject: [PATCH] rrcrtc: add initial gamma interfaces (v3) + +These are used by gnome-screensaver to do the fade in/out. + +Reviewed by ssp: removed unneeded crtc interfaces, +made get gamma to the allocs, for caller to free + +New interfaces: +Add gamma get/set functions per crtc. + +v3: coding style cleanups from ssp +--- + libgnome-desktop/gnome-rr.c | 75 ++++++++++++++++++++++++++++++++ + libgnome-desktop/libgnomeui/gnome-rr.h | 10 ++++ + 2 files changed, 85 insertions(+), 0 deletions(-) + +diff --git a/libgnome-desktop/gnome-rr.c b/libgnome-desktop/gnome-rr.c +index a64f8ae..9a93573 100644 +--- a/libgnome-desktop/gnome-rr.c ++++ b/libgnome-desktop/gnome-rr.c +@@ -74,6 +74,7 @@ struct GnomeRRCrtc + + GnomeRRRotation current_rotation; + GnomeRRRotation rotations; ++ int gamma_size; + }; + + struct GnomeRRMode +@@ -1447,6 +1448,9 @@ crtc_initialize (GnomeRRCrtc *crtc, + + XRRFreeCrtcInfo (info); + ++ /* get an store gamma size */ ++ crtc->gamma_size = XRRGetCrtcGammaSize (DISPLAY (crtc), crtc->id); ++ + return TRUE; + } + +@@ -1516,3 +1520,74 @@ mode_free (GnomeRRMode *mode) + g_free (mode->name); + g_free (mode); + } ++ ++void ++gnome_rr_crtc_set_gamma (GnomeRRCrtc *crtc, int size, ++ unsigned short *red, ++ unsigned short *green, ++ unsigned short *blue) ++{ ++ int copy_size; ++ XRRCrtcGamma *gamma; ++ ++ g_return_if_fail (crtc != NULL); ++ g_return_if_fail (red != NULL); ++ g_return_if_fail (green != NULL); ++ g_return_if_fail (blue != NULL); ++ ++ if (size != crtc->gamma_size) ++ return; ++ ++ gamma = XRRAllocGamma (crtc->gamma_size); ++ ++ copy_size = crtc->gamma_size * sizeof (unsigned short); ++ memcpy (gamma->red, red, copy_size); ++ memcpy (gamma->green, green, copy_size); ++ memcpy (gamma->blue, blue, copy_size); ++ ++ XRRSetCrtcGamma (DISPLAY (crtc), crtc->id, gamma); ++ XRRFreeGamma (gamma); ++} ++ ++gboolean ++gnome_rr_crtc_get_gamma (GnomeRRCrtc *crtc, int *size, ++ unsigned short **red, unsigned short **green, ++ unsigned short **blue) ++{ ++ int copy_size; ++ unsigned short *r, *g, *b; ++ XRRCrtcGamma *gamma; ++ ++ g_return_val_if_fail (crtc != NULL, FALSE); ++ ++ gamma = XRRGetCrtcGamma (DISPLAY (crtc), crtc->id); ++ if (!gamma) ++ return FALSE; ++ ++ copy_size = crtc->gamma_size * sizeof (unsigned short); ++ ++ if (red) { ++ r = g_new0 (unsigned short, crtc->gamma_size); ++ memcpy (r, gamma->red, copy_size); ++ *red = r; ++ } ++ ++ if (green) { ++ g = g_new0 (unsigned short, crtc->gamma_size); ++ memcpy (g, gamma->green, copy_size); ++ *green = g; ++ } ++ ++ if (blue) { ++ b = g_new0 (unsigned short, crtc->gamma_size); ++ memcpy (b, gamma->blue, copy_size); ++ *blue = b; ++ } ++ ++ XRRFreeGamma (gamma); ++ ++ if (size) ++ *size = crtc->gamma_size; ++ return TRUE; ++} ++ +diff --git a/libgnome-desktop/libgnomeui/gnome-rr.h b/libgnome-desktop/libgnomeui/gnome-rr.h +index 6eae3d0..e149336 100644 +--- a/libgnome-desktop/libgnomeui/gnome-rr.h ++++ b/libgnome-desktop/libgnomeui/gnome-rr.h +@@ -160,4 +160,14 @@ GnomeRRRotation gnome_rr_crtc_get_rotations (GnomeRRCrtc *crtc) + gboolean gnome_rr_crtc_supports_rotation (GnomeRRCrtc *crtc, + GnomeRRRotation rotation); + ++gboolean gnome_rr_crtc_get_gamma (GnomeRRCrtc *crtc, ++ int *size, ++ unsigned short **red, ++ unsigned short **green, ++ unsigned short **blue); ++void gnome_rr_crtc_set_gamma (GnomeRRCrtc *crtc, ++ int size, ++ unsigned short *red, ++ unsigned short *green, ++ unsigned short *blue); + #endif +-- +1.6.5.rc2 +