aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-05-08 16:29:18 +0200
committerMattias Andrée <maandree@operamail.com>2015-05-08 16:29:18 +0200
commitd939dd05e1fad24820bcee4142a5fca482dbbfb7 (patch)
tree2447df3fba8d1ae97c0152bd784fe9d0c0f1ab5b
parentupdate todo (diff)
downloadlibgamma-d939dd05e1fad24820bcee4142a5fca482dbbfb7.tar.gz
libgamma-d939dd05e1fad24820bcee4142a5fca482dbbfb7.tar.bz2
libgamma-d939dd05e1fad24820bcee4142a5fca482dbbfb7.tar.xz
add auto_restore to method caps
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r--TODO3
-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
8 files changed, 21 insertions, 6 deletions
diff --git a/TODO b/TODO
index 2b223c6..68a42b6 100644
--- a/TODO
+++ b/TODO
@@ -11,9 +11,6 @@ Unsupported display servers:
Mir I do not think Mir have gamma ramp support
-Adjustments in Quartz are reverted when the process exits,
-this information must be available in the method capabilities.
-
Gamma ramp support test should return yes, no or maybe.
Add hotplug support.
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;