From 776d445ec5f8a8d5791511c3909d2b02de7c3c31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Poisot?= Date: Sat, 1 Nov 2025 16:15:26 +0000 Subject: [PATCH] sway/commands/output: color_profile "srgb" applies the piece-wise TF Document that "gamma22" replaced the previous default. --- sway/commands/output/color_profile.c | 13 +++++++++++-- sway/sway-output.5.scd | 4 ++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/sway/commands/output/color_profile.c b/sway/commands/output/color_profile.c index 98481329b..b145d449b 100644 --- a/sway/commands/output/color_profile.c +++ b/sway/commands/output/color_profile.c @@ -59,11 +59,19 @@ struct cmd_results *output_cmd_color_profile(int argc, char **argv) { return cmd_results_new(CMD_INVALID, "Missing color_profile first argument."); } - if (strcmp(*argv, "srgb") == 0) { + if (strcmp(*argv, "gamma22") == 0) { wlr_color_transform_unref(config->handler_context.output_config->color_transform); config->handler_context.output_config->color_transform = NULL; config->handler_context.output_config->set_color_transform = true; + config->handler_context.leftovers.argc = argc - 1; + config->handler_context.leftovers.argv = argv + 1; + } else if (strcmp(*argv, "srgb") == 0) { + wlr_color_transform_unref(config->handler_context.output_config->color_transform); + config->handler_context.output_config->color_transform = + wlr_color_transform_init_linear_to_inverse_eotf(WLR_COLOR_TRANSFER_FUNCTION_SRGB); + config->handler_context.output_config->set_color_transform = true; + config->handler_context.leftovers.argc = argc - 1; config->handler_context.leftovers.argv = argv + 1; } else if (strcmp(*argv, "icc") == 0) { @@ -106,7 +114,8 @@ struct cmd_results *output_cmd_color_profile(int argc, char **argv) { config->handler_context.leftovers.argv = argv + 2; } else { return cmd_results_new(CMD_INVALID, - "Invalid color profile specification: first argument should be icc|srgb"); + "Invalid color profile specification: " + "first argument should be gamma22|icc|srgb"); } return NULL; diff --git a/sway/sway-output.5.scd b/sway/sway-output.5.scd index cc48589c3..afe213643 100644 --- a/sway/sway-output.5.scd +++ b/sway/sway-output.5.scd @@ -178,8 +178,8 @@ must be separated by one space. For example: updated to work with different bit depths. This command is experimental, and may be removed or changed in the future. -*output* color_profile srgb|[icc ] - Sets the color profile for an output. The default is _srgb_. should be a +*output* color_profile gamma22|srgb|[icc ] + Sets the color profile for an output. The default is _gamma22_. should be a path to a display ICC profile. Not all renderers support this feature; currently it only works with the