win: use correct geometry in calculation of window frame region

Use window geometry (width, height) including border-width as the base
for frame region calculation with `_NET_FRAME_EXTENTS`, instead of
including the extents themselves.
Fixes issues where the frame would get incorrectly blurred *outside* the
window area.

fixes: #413 #590

related: fb3305fb9b
This commit is contained in:
Bernd Busse 2021-06-28 20:10:00 +02:00
parent 5388ba0946
commit 83c19491b8
No known key found for this signature in database
GPG Key ID: 6DD2A3C48E63A5AB
1 changed files with 5 additions and 4 deletions

View File

@ -231,8 +231,8 @@ void win_get_region_noframe_local(const struct managed_win *w, region_t *res) {
int x = extents.left;
int y = extents.top;
int width = max2(w->g.width - (extents.left + extents.right), 0);
int height = max2(w->g.height - (extents.top + extents.bottom), 0);
int width = max2(w->widthb - (extents.left + extents.right), 0);
int height = max2(w->heightb - (extents.top + extents.bottom), 0);
pixman_region32_fini(res);
if (width > 0 && height > 0) {
@ -246,8 +246,9 @@ gen_without_corners(win_get_region_noframe_local);
void win_get_region_frame_local(const struct managed_win *w, region_t *res) {
const margin_t extents = win_calc_frame_extents(w);
auto outer_width = extents.left + extents.right + w->g.width;
auto outer_height = extents.top + extents.bottom + w->g.height;
auto outer_width = w->widthb;
auto outer_height = w->heightb;
pixman_region32_fini(res);
pixman_region32_init_rects(
res,