From 83c19491b80839655674a9af9cc341d3371cec73 Mon Sep 17 00:00:00 2001 From: Bernd Busse Date: Mon, 28 Jun 2021 20:10:00 +0200 Subject: [PATCH 1/2] 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: fb3305fb9bf7801f0b8608cd92f90d8b548688a8 --- src/win.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/win.c b/src/win.c index e47b626..f2ab1f5 100644 --- a/src/win.c +++ b/src/win.c @@ -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, From b5ce81aa47eb6594c40cefedf24404dc54507dca Mon Sep 17 00:00:00 2001 From: Bernd Busse Date: Tue, 6 Jul 2021 18:40:10 +0200 Subject: [PATCH 2/2] event: never ignore changed frame extents Changes to frame extents were only tracked if the frame was visible, but we have to keep this information current even for invisible frames to (not) render the correct area. --- src/event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/event.c b/src/event.c index 1fb033c..b022631 100644 --- a/src/event.c +++ b/src/event.c @@ -506,7 +506,7 @@ static inline void ev_property_notify(session_t *ps, xcb_property_notify_event_t } // If frame extents property changes - if (ps->o.frame_opacity > 0 && ev->atom == ps->atoms->a_NET_FRAME_EXTENTS) { + if (ev->atom == ps->atoms->a_NET_FRAME_EXTENTS) { auto w = find_toplevel(ps, ev->window); if (w) { win_set_property_stale(w, ev->atom);