From e4221e078784a6432aa63750772aeaa04e25ba90 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Wed, 24 Aug 2022 08:12:59 +0100 Subject: [PATCH] backend: don't clip corners when painting shadow When removing shadow behind a window with rounded corners, keep the corner part - those parts will be removed using the mask instead. Signed-off-by: Yuxuan Shui --- src/backend/backend.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/backend/backend.c b/src/backend/backend.c index 92fe96d..796e7be 100644 --- a/src/backend/backend.c +++ b/src/backend/backend.c @@ -204,6 +204,8 @@ void paint_all_new(session_t *ps, struct managed_win *t, bool ignore_damage) { // The bounding shape of the window, in global/target coordinates // reminder: bounding shape contains the WM frame auto reg_bound = win_get_bounding_shape_global_by_val(w); + auto reg_bound_no_corner = + win_get_bounding_shape_global_without_corners_by_val(w); region_t reg_bound_local; pixman_region32_init(®_bound_local); pixman_region32_copy(®_bound_local, ®_bound); @@ -361,7 +363,8 @@ void paint_all_new(session_t *ps, struct managed_win *t, bool ignore_damage) { auto inverted_mask = NULL; if (!ps->o.wintype_option[w->window_type].full_shadow) { - pixman_region32_subtract(®_shadow, ®_shadow, ®_bound); + pixman_region32_subtract(®_shadow, ®_shadow, + ®_bound_no_corner); if (w->mask_image) { inverted_mask = w->mask_image; ps->backend_data->ops->set_image_property( @@ -483,6 +486,7 @@ void paint_all_new(session_t *ps, struct managed_win *t, bool ignore_damage) { skip: pixman_region32_fini(®_bound); pixman_region32_fini(®_bound_local); + pixman_region32_fini(®_bound_no_corner); pixman_region32_fini(®_paint_in_bound); } pixman_region32_fini(®_paint);