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 <yshuiv7@gmail.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user