|
10 | 10 | #include <wlr/render/allocator.h>
|
11 | 11 | #include <wlr/render/wlr_renderer.h>
|
12 | 12 | #include <wlr/types/wlr_alpha_modifier_v1.h>
|
| 13 | +#include <wlr/types/wlr_color_management_v1.h> |
13 | 14 | #include <wlr/types/wlr_compositor.h>
|
14 | 15 | #include <wlr/types/wlr_content_type_v1.h>
|
15 | 16 | #include <wlr/types/wlr_cursor_shape_v1.h>
|
@@ -411,6 +412,30 @@ bool server_init(struct sway_server *server) {
|
411 | 412 | server->request_set_cursor_shape.notify = handle_request_set_cursor_shape;
|
412 | 413 | wl_signal_add(&cursor_shape_manager->events.request_set_shape, &server->request_set_cursor_shape);
|
413 | 414 |
|
| 415 | + const enum wp_color_manager_v1_render_intent render_intents[] = { |
| 416 | + WP_COLOR_MANAGER_V1_RENDER_INTENT_PERCEPTUAL, |
| 417 | + }; |
| 418 | + const enum wp_color_manager_v1_transfer_function transfer_functions[] = { |
| 419 | + WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_SRGB, |
| 420 | + WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_ST2084_PQ, |
| 421 | + }; |
| 422 | + const enum wp_color_manager_v1_primaries primaries[] = { |
| 423 | + WP_COLOR_MANAGER_V1_PRIMARIES_SRGB, |
| 424 | + WP_COLOR_MANAGER_V1_PRIMARIES_BT2020, |
| 425 | + }; |
| 426 | + wlr_color_manager_v1_create(server->wl_display, 1, &(struct wlr_color_manager_v1_options){ |
| 427 | + .features = { |
| 428 | + .parametric = true, |
| 429 | + .set_mastering_display_primaries = true, |
| 430 | + }, |
| 431 | + .render_intents = render_intents, |
| 432 | + .render_intents_len = sizeof(render_intents) / sizeof(render_intents[0]), |
| 433 | + .transfer_functions = transfer_functions, |
| 434 | + .transfer_functions_len = sizeof(transfer_functions) / sizeof(transfer_functions[0]), |
| 435 | + .primaries = primaries, |
| 436 | + .primaries_len = sizeof(primaries) / sizeof(primaries[0]), |
| 437 | + }); |
| 438 | + |
414 | 439 | wl_list_init(&server->pending_launcher_ctxs);
|
415 | 440 |
|
416 | 441 | // Avoid using "wayland-0" as display socket
|
|
0 commit comments