mirror of
https://github.com/labwc/labwc.git
synced 2026-04-07 08:21:20 -04:00
server: add support for color-management-v1 minor-version 2
server.c: fix build error by using workspace_tree
This commit is contained in:
parent
c3fc78286a
commit
31d25aee2a
2 changed files with 44 additions and 0 deletions
|
|
@ -25,6 +25,7 @@ server_protocols = [
|
|||
wl_protocol_dir / 'staging/ext-workspace/ext-workspace-v1.xml',
|
||||
wl_protocol_dir / 'staging/ext-image-capture-source/ext-image-capture-source-v1.xml',
|
||||
wl_protocol_dir / 'staging/ext-image-copy-capture/ext-image-copy-capture-v1.xml',
|
||||
wl_protocol_dir / 'staging/color-management/color-management-v1.xml',
|
||||
'cosmic-workspace-unstable-v1.xml',
|
||||
'wlr-layer-shell-unstable-v1.xml',
|
||||
'wlr-output-power-management-unstable-v1.xml',
|
||||
|
|
|
|||
43
src/server.c
43
src/server.c
|
|
@ -8,6 +8,8 @@
|
|||
#include <wlr/backend/multi.h>
|
||||
#include <wlr/render/allocator.h>
|
||||
#include <wlr/types/wlr_alpha_modifier_v1.h>
|
||||
#include <wlr/types/wlr_color_management_v1.h>
|
||||
#include <wlr/types/wlr_color_representation_v1.h>
|
||||
#include <wlr/types/wlr_data_control_v1.h>
|
||||
#include <wlr/types/wlr_data_device.h>
|
||||
#include <wlr/types/wlr_drm.h>
|
||||
|
|
@ -584,6 +586,47 @@ server_init(void)
|
|||
* | output->layer_tree[0] | background layer surfaces (e.g. swaybg)
|
||||
*/
|
||||
|
||||
if (server.renderer->features.input_color_transform) {
|
||||
const enum wp_color_manager_v1_render_intent render_intents[] = {
|
||||
WP_COLOR_MANAGER_V1_RENDER_INTENT_PERCEPTUAL,
|
||||
};
|
||||
size_t transfer_functions_len = 0;
|
||||
enum wp_color_manager_v1_transfer_function *transfer_functions =
|
||||
wlr_color_manager_v1_transfer_function_list_from_renderer(
|
||||
server.renderer, &transfer_functions_len);
|
||||
|
||||
size_t primaries_len = 0;
|
||||
enum wp_color_manager_v1_primaries *primaries =
|
||||
wlr_color_manager_v1_primaries_list_from_renderer(
|
||||
server.renderer, &primaries_len);
|
||||
|
||||
struct wlr_color_manager_v1 *cm = wlr_color_manager_v1_create(
|
||||
server.wl_display, 2, &(struct wlr_color_manager_v1_options){
|
||||
.features = {
|
||||
.parametric = true,
|
||||
.set_mastering_display_primaries = true,
|
||||
},
|
||||
.render_intents = render_intents,
|
||||
.render_intents_len = ARRAY_SIZE(render_intents),
|
||||
.transfer_functions = transfer_functions,
|
||||
.transfer_functions_len = transfer_functions_len,
|
||||
.primaries = primaries,
|
||||
.primaries_len = primaries_len,
|
||||
});
|
||||
|
||||
free(transfer_functions);
|
||||
free(primaries);
|
||||
|
||||
if (cm) {
|
||||
wlr_scene_set_color_manager_v1(server.scene, cm);
|
||||
} else {
|
||||
wlr_log(WLR_ERROR, "unable to create color manager");
|
||||
}
|
||||
}
|
||||
|
||||
wlr_color_representation_manager_v1_create_with_renderer(
|
||||
server.wl_display, 1, server.renderer);
|
||||
|
||||
server.workspace_tree = lab_wlr_scene_tree_create(&server.scene->tree);
|
||||
server.xdg_popup_tree = lab_wlr_scene_tree_create(&server.scene->tree);
|
||||
#if HAVE_XWAYLAND
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue