mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-29 05:40:12 -04:00
gamma_control_v1: introduce fallback_gamma_size
This commit is contained in:
parent
91f4890ec2
commit
3e08e3be4a
2 changed files with 8 additions and 0 deletions
|
|
@ -10,6 +10,11 @@ struct wlr_gamma_control_manager_v1 {
|
||||||
struct wl_global *global;
|
struct wl_global *global;
|
||||||
struct wl_list controls; // wlr_gamma_control_v1.link
|
struct wl_list controls; // wlr_gamma_control_v1.link
|
||||||
|
|
||||||
|
// Fallback to use when an struct wlr_output doesn't support gamma LUTs.
|
||||||
|
// Can be used to apply gamma LUTs via a struct wlr_renderer. Leave zero to
|
||||||
|
// indicate that the fallback is unsupported.
|
||||||
|
size_t fallback_gamma_size;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
struct wl_signal destroy;
|
struct wl_signal destroy;
|
||||||
struct wl_signal set_gamma; // struct wlr_gamma_control_manager_v1_set_gamma_event
|
struct wl_signal set_gamma; // struct wlr_gamma_control_manager_v1_set_gamma_event
|
||||||
|
|
|
||||||
|
|
@ -157,6 +157,9 @@ static void gamma_control_manager_get_gamma_control(struct wl_client *client,
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t gamma_size = wlr_output_get_gamma_size(output);
|
size_t gamma_size = wlr_output_get_gamma_size(output);
|
||||||
|
if (gamma_size == 0) {
|
||||||
|
gamma_size = manager->fallback_gamma_size;
|
||||||
|
}
|
||||||
if (gamma_size == 0) {
|
if (gamma_size == 0) {
|
||||||
zwlr_gamma_control_v1_send_failed(resource);
|
zwlr_gamma_control_v1_send_failed(resource);
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue