[gnome-color-manager/colord: 56/72] If there are no profiles for the XRandr output, then reset the gamma ramps to linear



commit 5823866db8c396a07dd1b5434568879194d7a790
Author: Richard Hughes <richard hughsie com>
Date:   Fri Feb 11 16:17:35 2011 +0000

    If there are no profiles for the XRandr output, then reset the gamma ramps to linear
    
    We need to do this for profiling...

 src/gcm-session.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/src/gcm-session.c b/src/gcm-session.c
index 8f33e31..d8868d3 100644
--- a/src/gcm-session.c
+++ b/src/gcm-session.c
@@ -460,7 +460,7 @@ gcm_session_device_assign (CdDevice *device)
 	if (kind != CD_DEVICE_KIND_DISPLAY)
 		return;
 
-	g_debug ("need to add display device %s",
+	g_debug ("need to assign display device %s",
 		 cd_device_get_id (device));
 
 	/* get the GcmX11Output for the device id */
@@ -543,6 +543,17 @@ gcm_session_device_assign (CdDevice *device)
 				g_clear_error (&error);
 			}
 		}
+
+		/* reset, as we want linear profiles for profiling */
+		ret = gcm_session_device_reset_gamma (output,
+						      &error);
+		if (!ret) {
+			g_warning ("failed to reset %s gamma tables: %s",
+				   cd_device_get_id (device),
+				   error->message);
+			g_error_free (error);
+			goto out;
+		}
 		goto out;
 	}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]