From 0899a9689ee9403e2cdcdc129c14e7a4a6476e6e Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Sun, 9 Dec 2018 21:00:32 +0000 Subject: [PATCH] Remove unused variable in paint_preprocess And fix a memory leak caused by it. Signed-off-by: Yuxuan Shui --- src/compton.c | 5 ----- src/win.c | 3 ++- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/compton.c b/src/compton.c index f77d17e..fc81976 100644 --- a/src/compton.c +++ b/src/compton.c @@ -1292,11 +1292,6 @@ paint_preprocess(session_t *ps, win *list) { if (!to_paint) goto skip_window; - // Fetch window extents - region_t extents; - pixman_region32_init(&extents); - win_extents(w, &extents); - // Calculate shadow opacity w->shadow_opacity = ps->o.shadow_opacity * get_opacity_percent(w) * ps->o.frame_opacity; diff --git a/src/win.c b/src/win.c index 27eaff2..000a4ce 100644 --- a/src/win.c +++ b/src/win.c @@ -1138,7 +1138,8 @@ void win_extents(win *w, region_t *res) { pixman_region32_union_rect(res, res, w->g.x, w->g.y, w->widthb, w->heightb); if (w->shadow) - pixman_region32_union_rect(res, res, w->g.x + w->shadow_dx, w->g.y + w->shadow_dy, w->shadow_width, w->shadow_height); + pixman_region32_union_rect(res, res, w->g.x + w->shadow_dx, + w->g.y + w->shadow_dy, w->shadow_width, w->shadow_height); } /**