From d939dd05e1fad24820bcee4142a5fca482dbbfb7 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 8 May 2015 16:29:18 +0200 Subject: add auto_restore to method caps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/lib/gamma-dummy.c.gpp | 4 +++- src/lib/gamma-linux-drm.c | 2 ++ src/lib/gamma-quartz-cg.c | 2 ++ src/lib/gamma-w32-gdi.c | 2 ++ src/lib/gamma-x-randr.c | 4 +++- src/lib/gamma-x-vidmode.c | 2 ++ src/lib/libgamma-method.h | 8 +++++++- 7 files changed, 21 insertions(+), 3 deletions(-) (limited to 'src/lib') diff --git a/src/lib/gamma-dummy.c.gpp b/src/lib/gamma-dummy.c.gpp index 96bfcc7..2c89b45 100644 --- a/src/lib/gamma-dummy.c.gpp +++ b/src/lib/gamma-dummy.c.gpp @@ -295,9 +295,11 @@ static libgamma_dummy_configurations_t libgamma_dummy_configurations = */ void libgamma_dummy_method_capabilities(libgamma_method_capabilities_t* restrict this) { + int real_method = libgamma_dummy_configurations.real_method; *this = libgamma_dummy_configurations.capabilities; - this->real = libgamma_dummy_configurations.real_method != LIBGAMMA_METHOD_DUMMY; + this->real = real_method != LIBGAMMA_METHOD_DUMMY; this->fake = this->real; + this->auto_restore = real_method == LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS; } diff --git a/src/lib/gamma-linux-drm.c b/src/lib/gamma-linux-drm.c index 6774e02..a35f49b 100644 --- a/src/lib/gamma-linux-drm.c +++ b/src/lib/gamma-linux-drm.c @@ -114,6 +114,8 @@ void libgamma_linux_drm_method_capabilities(libgamma_method_capabilities_t* rest /* DRM is a real non-faked adjustment method */ this->real = 1; this->fake = 0; + /* Gamma ramp adjustments are persistent. */ + this->auto_restore = 0; } diff --git a/src/lib/gamma-quartz-cg.c b/src/lib/gamma-quartz-cg.c index 7f6904a..d509ce8 100644 --- a/src/lib/gamma-quartz-cg.c +++ b/src/lib/gamma-quartz-cg.c @@ -77,6 +77,8 @@ void libgamma_quartz_cg_method_capabilities(libgamma_method_capabilities_t* rest this->fake = 0; this->real = 1; #endif + /* Gamma ramp adjustments are non-persistent. */ + this->auto_restore = 1; } diff --git a/src/lib/gamma-w32-gdi.c b/src/lib/gamma-w32-gdi.c index 8104b18..7a55b1b 100644 --- a/src/lib/gamma-w32-gdi.c +++ b/src/lib/gamma-w32-gdi.c @@ -84,6 +84,8 @@ void libgamma_w32_gdi_method_capabilities(libgamma_method_capabilities_t* restri this->fake = 0; this->real = 1; #endif + /* Gamma ramp adjustments are persistent. */ + this->auto_restore = 0; } diff --git a/src/lib/gamma-x-randr.c b/src/lib/gamma-x-randr.c index 21b6ca6..b3115a6 100644 --- a/src/lib/gamma-x-randr.c +++ b/src/lib/gamma-x-randr.c @@ -155,9 +155,11 @@ void libgamma_x_randr_method_capabilities(libgamma_method_capabilities_t* restri this->fixed_gamma_size = 0; /* Gamma ramp depths are fixed. */ this->fixed_gamma_depth = 1; - /* X RandR is a real non-faked adjustment method */ + /* X RandR is a real non-faked adjustment method. */ this->real = 1; this->fake = 0; + /* Gamma ramp adjustments are persistent. */ + this->auto_restore = 0; } diff --git a/src/lib/gamma-x-vidmode.c b/src/lib/gamma-x-vidmode.c index 29fdc4f..51c86e6 100644 --- a/src/lib/gamma-x-vidmode.c +++ b/src/lib/gamma-x-vidmode.c @@ -60,6 +60,8 @@ void libgamma_x_vidmode_method_capabilities(libgamma_method_capabilities_t* rest /* X VidMode is a real non-faked adjustment method */ this->real = 1; this->fake = 0; + /* Gamma ramp adjustments are persistent. */ + this->auto_restore = 0; } diff --git a/src/lib/libgamma-method.h b/src/lib/libgamma-method.h index 90fd25c..fc402ec 100644 --- a/src/lib/libgamma-method.h +++ b/src/lib/libgamma-method.h @@ -156,7 +156,7 @@ typedef struct libgamma_method_capabilities * Whether the adjustment method supports `libgamma_crtc_restore`. */ unsigned crtc_restore : 1; - + /** * Whether the `red_gamma_size`, `green_gamma_size` and `blue_gamma_size` * fields in `libgamma_crtc_information_t` will always have the same @@ -187,6 +187,12 @@ typedef struct libgamma_method_capabilities */ unsigned fake : 1; + /** + * Whether adjustments are undone when the process disconnects from + * the display server. + */ + unsigned auto_restore : 1; + } libgamma_method_capabilities_t; -- cgit v1.2.3-70-g09d2