From e075444663c854fde18f8d20c1bececc96a5c4ff Mon Sep 17 00:00:00 2001 From: Jon Lund Steffensen Date: Fri, 13 Oct 2017 19:08:55 -0700 Subject: Change preserve option to command line switch Changes each adjustment method to take a preserve parameter when setting the temperature instead of parsing the preserve option from the command line/configuration file. This helps resolve the issues around #513: - This allows the preserve option to be implemented as a command-line switch (-P). This switch _disables_ the preservation of existing gamma ramps. Having a command-line switch makes it easier to use directly with manual or one-shot mode. - The preserve options is on by default, so continual mode as well as other modes will default to applying the color adjustment on top of the current gamma ramps. - Preserve is always disabled in reset mode so resetting works as expected again. --- src/gamma-drm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/gamma-drm.c') diff --git a/src/gamma-drm.c b/src/gamma-drm.c index 67f819e..c0863e5 100644 --- a/src/gamma-drm.c +++ b/src/gamma-drm.c @@ -269,7 +269,8 @@ drm_set_option(drm_state_t *state, const char *key, const char *value) } static int -drm_set_temperature(drm_state_t *state, const color_setting_t *setting) +drm_set_temperature( + drm_state_t *state, const color_setting_t *setting, int preserve) { drm_crtc_state_t *crtcs = state->crtcs; int last_gamma_size = 0; -- cgit v1.2.3-70-g09d2