From b61c9d59d7456dc5a4106e5f1e6b767df290d7be Mon Sep 17 00:00:00 2001 From: Jon Lund Steffensen Date: Fri, 1 Jan 2010 19:24:01 +0100 Subject: Reuse X connection when adjusting gamma ramps. Save gamma ramps when program starts and restore them on exit (only RANDR). Try both RANDR and VidMode if nothing was specified, otherwise try only the specified method. --- src/vidmode.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/vidmode.h') diff --git a/src/vidmode.h b/src/vidmode.h index cf5516c..b342254 100644 --- a/src/vidmode.h +++ b/src/vidmode.h @@ -20,7 +20,16 @@ #ifndef _REDSHIFT_VIDMODE_H #define _REDSHIFT_VIDMODE_H -int vidmode_check_extension(); -int vidmode_set_temperature(int screen_num, int temp, float gamma[3]); +#include + +typedef struct { + Display *display; + int screen_num; +} vidmode_state_t; + +int vidmode_init(vidmode_state_t *state, int screen_num); +void vidmode_free(vidmode_state_t *state); +void vidmode_restore(vidmode_state_t *state); +int vidmode_set_temperature(vidmode_state_t *state, int temp, float gamma[3]); #endif /* ! _REDSHIFT_VIDMODE_H */ -- cgit v1.2.3-70-g09d2