Skip to content

Commit

Permalink
renderer: fix force_win_blend has no effect on window body
Browse files Browse the repository at this point in the history
Fixes #1354

Signed-off-by: Yuxuan Shui <[email protected]>
  • Loading branch information
yshui committed Oct 11, 2024
1 parent dadfe5a commit 0794447
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
9 changes: 5 additions & 4 deletions src/renderer/command_builder.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 0794447

Please sign in to comment.