From 07944478474c7a7f64928bb1e2c544940ba28694 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Fri, 11 Oct 2024 17:09:41 +0100 Subject: [PATCH] renderer: fix force_win_blend has no effect on window body Fixes #1354 Signed-off-by: Yuxuan Shui --- CHANGELOG.md | 1 + src/renderer/command_builder.c | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 174da0c4c9..372d859bda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Bug fixes * Fix memory corruption that can happen when handling window property changes (#1350) +* Fix `force-win-blend` having no effect (#1354) # 12.2 (2024-Oct-10) diff --git a/src/renderer/command_builder.c b/src/renderer/command_builder.c index c3ffdf41cb..3f26a1fd9c 100644 --- a/src/renderer/command_builder.c +++ b/src/renderer/command_builder.c @@ -16,7 +16,7 @@ /// @return number of commands generated static inline unsigned commands_for_window_body(struct layer *layer, struct backend_command *cmd_base, - const region_t *frame_region, bool inactive_dim_fixed, + const region_t *frame_region, bool inactive_dim_fixed, bool force_blend, double max_brightness, const struct shader_info *shaders) { auto w = layer->win; auto cmd = cmd_base; @@ -39,7 +39,8 @@ commands_for_window_body(struct layer *layer, struct backend_command *cmd_base, pixman_region32_subtract(&cmd->target_mask, &cmd->target_mask, frame_region); } pixman_region32_init(&cmd->opaque_region); - if ((mode == WMODE_SOLID || mode == WMODE_FRAME_TRANS) && layer->opacity == 1.0) { + if ((mode == WMODE_SOLID || mode == WMODE_FRAME_TRANS) && layer->opacity == 1.0 && + !force_blend) { pixman_region32_copy(&cmd->opaque_region, &cmd->target_mask); if (mode == WMODE_FRAME_TRANS) { pixman_region32_subtract(&cmd->opaque_region, &cmd->opaque_region, @@ -450,8 +451,8 @@ void command_builder_build(struct command_builder *cb, struct layout *layout, layer->window.origin.y); // Add window body - cmd -= commands_for_window_body( - layer, cmd, &frame_region, inactive_dim_fixed, max_brightness, shaders); + cmd -= commands_for_window_body(layer, cmd, &frame_region, inactive_dim_fixed, + force_blend, max_brightness, shaders); // Add shadow cmd -= command_for_shadow(layer, cmd, monitors, last + 1);