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.
This commit is contained in:
parent
a545ddef17
commit
fe0eda27bd
1 changed files with 5 additions and 5 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue