From fe0eda27bd192c3d5e108372c31b495401a94103 Mon Sep 17 00:00:00 2001 From: Mathias Gumz Date: Sun, 23 Oct 2011 11:58:32 +0200 Subject: bugfix: use the imlib cache for every imlib context used calling imlib_set_cache_size() before a context is created by fluxbox creates an 'unknown' context. that one is never freed at shutdown. --- src/FbTk/ImageImlib2.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/FbTk/ImageImlib2.cc b/src/FbTk/ImageImlib2.cc index 0f2ece8..21202a1 100644 --- a/src/FbTk/ImageImlib2.cc +++ b/src/FbTk/ImageImlib2.cc @@ -53,10 +53,6 @@ namespace FbTk { ImageImlib2::ImageImlib2() { - // lets have a 2mb cache inside imlib, holds - // uncompressed images - imlib_set_cache_size(2048 * 1024); - // TODO: this are the potential candidates, // choose only sane ones. open for discussion static const char* format_list[] = { @@ -90,12 +86,16 @@ PixmapWithMask *ImageImlib2::load(const std::string &filename, int screen_num) c Imlib_Context new_context = imlib_context_new(); imlib_context_push(new_context); - + imlib_context_set_display(dpy); imlib_context_set_visual(DefaultVisual(dpy, screen_num)); imlib_context_set_colormap(DefaultColormap(dpy, screen_num)); imlib_context_set_drawable(RootWindow(dpy, screen_num)); + // lets have a 2mb cache inside imlib, holds + // uncompressed images + imlib_set_cache_size(2048 * 1024); + imlib_context_pop(); contexts[screen_num] = new_context; -- cgit v0.11.2