Fixed output damage not accounting for shadow

This commit is contained in:
Erik Reider 2022-12-29 19:47:01 +01:00 committed by Will McKinnon
parent e65aceba67
commit 18b1468fb0

View file

@ -699,11 +699,12 @@ static void damage_child_views_iterator(struct sway_container *con,
void output_damage_whole_container(struct sway_output *output, void output_damage_whole_container(struct sway_output *output,
struct sway_container *con) { struct sway_container *con) {
// Pad the box by 1px, because the width is a double and might be a fraction // Pad the box by 1px, because the width is a double and might be a fraction
int shadow_sigma = con->shadow_enabled ? config->shadow_blur_sigma : 0;
struct wlr_box box = { struct wlr_box box = {
.x = con->current.x - output->lx - 1, .x = con->current.x - output->lx - 1 - shadow_sigma,
.y = con->current.y - output->ly - 1, .y = con->current.y - output->ly - 1 - shadow_sigma,
.width = con->current.width + 2, .width = con->current.width + 2 + shadow_sigma * 2,
.height = con->current.height + 2, .height = con->current.height + 2 + shadow_sigma * 2,
}; };
scale_box(&box, output->wlr_output->scale); scale_box(&box, output->wlr_output->scale);
wlr_output_damage_add_box(output->damage, &box); wlr_output_damage_add_box(output->damage, &box);