diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2017-03-27 22:38:02 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2017-03-27 22:38:02 -0700 |
commit | 76c169b87e73ca85605881b602c2e760b0438c34 (patch) | |
tree | 723b8865626c4ee575afa56699cd859025be53ba | |
parent | 221587a31b4ffe42a6f4d0b0f817e2a2cedcfb45 (diff) |
charts: don't copy or free zero charts
This was mixed up a bit in the cleanups... charts of !width represent the
uninitialized charts, so don't copy or free them instead of inhibiting
just the copy.
-rw-r--r-- | src/charts.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/charts.c b/src/charts.c index 46e10da..7100cbb 100644 --- a/src/charts.c +++ b/src/charts.c @@ -931,9 +931,6 @@ static void copy_chart_pictures(vwm_charts_t *charts, vwm_chart_t *src, vwm_char { vwm_xserver_t *xserver = charts->xserver; - if (!src->width) - return; - /* XXX: note the graph pictures are copied from their current phase in the x dimension */ XRenderComposite(xserver->display, PictOpSrc, src->grapha_picture, None, dest->grapha_picture, src->phase, 0, /* src x, y */ @@ -989,8 +986,10 @@ int vwm_chart_set_visible_size(vwm_charts_t *charts, vwm_chart_t *chart, int wid chart->shadow_picture = create_picture_fill(charts, chart->width, chart->height, CHART_MASK_DEPTH, 0, NULL, &chart_trans_color, NULL); chart->picture = create_picture(charts, chart->width, chart->height, 32, 0, NULL, NULL); - copy_chart_pictures(charts, &existing, chart); - free_chart_pictures(charts, &existing); + if (existing.width) { + copy_chart_pictures(charts, &existing, chart); + free_chart_pictures(charts, &existing); + } } chart->visible_width = width; |