1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-27 20:44:56 +00:00

Fixup some imlib2 flush interval stuff.

This commit is contained in:
Brenden Matthews 2009-06-14 16:12:12 -06:00
parent 07cfe08dd3
commit 8b9f0b6851

View File

@ -64,7 +64,11 @@ void cimlib_set_cache_size(long size)
void cimlib_set_cache_flush_interval(long interval) void cimlib_set_cache_flush_interval(long interval)
{ {
cimlib_cache_flush_interval = interval; if (interval >= 0) {
cimlib_cache_flush_interval = interval;
} else {
ERR("Imlib2: flush interval should be >= 0");
}
} }
void cimlib_cleanup(void) void cimlib_cleanup(void)
@ -131,6 +135,10 @@ void cimlib_add_image(const char *args)
cur->no_cache = 0; cur->no_cache = 0;
} }
} }
if (cur->flush_interval < 0) {
ERR("Imlib2: flush interval should be >= 0");
cur->flush_interval = 0;
}
if (image_list_end) { if (image_list_end) {
image_list_end->next = cur; image_list_end->next = cur;
@ -160,7 +168,7 @@ static void cimlib_draw_image(struct image_list_s *cur, int *clip_x, int *clip_y
imlib_blend_image_onto_image(image, 1, 0, 0, w, h, imlib_blend_image_onto_image(image, 1, 0, 0, w, h,
cur->x, cur->y, cur->w, cur->h); cur->x, cur->y, cur->w, cur->h);
imlib_context_set_image(image); imlib_context_set_image(image);
if (cur->no_cache || (now % cur->flush_interval == 0)) { if (cur->no_cache || (cur->flush_interval && now % cur->flush_interval == 0)) {
imlib_free_image_and_decache(); imlib_free_image_and_decache();
} else { } else {
imlib_free_image(); imlib_free_image();