aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/gamma-dummy.c.gpp4
-rw-r--r--src/lib/gamma-linux-drm.c2
-rw-r--r--src/lib/gamma-quartz-cg.c2
-rw-r--r--src/lib/gamma-w32-gdi.c2
-rw-r--r--src/lib/gamma-x-randr.c4
-rw-r--r--src/lib/gamma-x-vidmode.c2
-rw-r--r--src/lib/libgamma-method.h8
7 files changed, 21 insertions, 3 deletions
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;