diff options
author | Mattias Andrée <m@maandree.se> | 2025-03-05 09:14:17 +0100 |
---|---|---|
committer | Mattias Andrée <m@maandree.se> | 2025-03-05 09:14:17 +0100 |
commit | 6c518351ef1a7fc144d3689165fbe582d1ee72fc (patch) | |
tree | daf5f57999a889a14506de4af7136d025476d338 /src/redshift.c | |
parent | Update my e-mail address (diff) | |
parent | Add coopgamma backend (diff) | |
download | redshift-ng-6c518351ef1a7fc144d3689165fbe582d1ee72fc.tar.gz redshift-ng-6c518351ef1a7fc144d3689165fbe582d1ee72fc.tar.bz2 redshift-ng-6c518351ef1a7fc144d3689165fbe582d1ee72fc.tar.xz |
Merge branch 'coopgamma' of https://github.com/maandree/redshift
Diffstat (limited to 'src/redshift.c')
-rw-r--r-- | src/redshift.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/redshift.c b/src/redshift.c index b880457..d2e79f6 100644 --- a/src/redshift.c +++ b/src/redshift.c @@ -75,6 +75,10 @@ int poll(struct pollfd *fds, int nfds, int timeout) { abort(); return -1; } #include "gamma-dummy.h" +#ifdef ENABLE_COOPGAMMA +# include "gamma-coopgamma.h" +#endif + #ifdef ENABLE_DRM # include "gamma-drm.h" #endif @@ -129,7 +133,6 @@ int poll(struct pollfd *fds, int nfds, int timeout) { abort(); return -1; } /* Length of fade in numbers of short sleep durations. */ #define FADE_LENGTH 40 - /* Names of periods of day */ static const char *period_names[] = { /* TRANSLATORS: Name printed when period of day is unknown */ @@ -411,8 +414,8 @@ provider_try_start(const location_provider_t *provider, } static int -method_try_start(const gamma_method_t *method, - gamma_state_t **state, config_ini_state_t *config, char *args) +method_try_start(const gamma_method_t *method, gamma_state_t **state, + program_mode_t mode, config_ini_state_t *config, char *args) { int r; @@ -477,7 +480,7 @@ method_try_start(const gamma_method_t *method, } /* Start method. */ - r = method->start(*state); + r = method->start(*state, mode); if (r < 0) { method->free(*state); fprintf(stderr, _("Failed to start adjustment method %s.\n"), @@ -907,6 +910,9 @@ main(int argc, char *argv[]) /* List of gamma methods. */ const gamma_method_t gamma_methods[] = { +#ifdef ENABLE_COOPGAMMA + coopgamma_gamma_method, +#endif #ifdef ENABLE_DRM drm_gamma_method, #endif @@ -1130,7 +1136,7 @@ main(int argc, char *argv[]) if (options.method != NULL) { /* Use method specified on command line. */ r = method_try_start( - options.method, &method_state, &config_state, + options.method, &method_state, options.mode, &config_state, options.method_args); if (r < 0) exit(EXIT_FAILURE); } else { @@ -1140,7 +1146,7 @@ main(int argc, char *argv[]) if (!m->autostart) continue; r = method_try_start( - m, &method_state, &config_state, NULL); + m, &method_state, options.mode, &config_state, NULL); if (r < 0) { fputs(_("Trying next method...\n"), stderr); continue; |