summaryrefslogtreecommitdiff
path: root/src/composite.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@gnugeneration.com>2017-02-22 09:37:39 -0800
committerVito Caputo <vcaputo@gnugeneration.com>2017-02-22 09:37:39 -0800
commit3d8f1432e555af373e7ccc3b6fffc80b70533888 (patch)
treec6d74a8551ee344e22795bb577095ef3fb5f5eba /src/composite.c
parent04d82b8968b6f5eea263dd6ab8302fff059cad9e (diff)
composite: fix occluded region leak
When vwm_composite_paint_all() short-circuited, occluded wasn't destroyed. Defer the occluded region create to its time of need, which is after the short-circuit, and followed immediately by its destruction.
Diffstat (limited to 'src/composite.c')
-rw-r--r--src/composite.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/composite.c b/src/composite.c
index afa4add..df157f6 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -173,7 +173,7 @@ void vwm_composite_paint_all(vwm_t *vwm)
{
vwm_xwindow_t *xwin;
XRenderColor bgcolor = {0x0000, 0x00, 0x00, 0xffff};
- Region occluded = XCreateRegion();
+ Region occluded;
static XserverRegion undamage_region = None;
/* if there's no damage to repaint, short-circuit, this happens when compositing for overlays is disabled. */
@@ -196,6 +196,7 @@ void vwm_composite_paint_all(vwm_t *vwm)
XFreePixmap(vwm->display, root_pixmap);
}
+ occluded = XCreateRegion();
/* compose overlays for all visible windows up front in a separate pass (kind of lame, but it's simpler since compose_overlay() adds to combined_damage) */
list_for_each_entry_prev(xwin, &vwm->xwindows, xwindows) {
XRectangle r;
© All Rights Reserved