aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2011-10-23 09:58:32 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2011-10-23 09:58:32 (GMT)
commitfe0eda27bd192c3d5e108372c31b495401a94103 (patch)
tree2d3d8575be40b970f47d4c7dfccad4c6df612443
parenta545ddef177c6bcd75d2e006838687a35393fcce (diff)
downloadfluxbox-fe0eda27bd192c3d5e108372c31b495401a94103.zip
fluxbox-fe0eda27bd192c3d5e108372c31b495401a94103.tar.bz2
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.
-rw-r--r--src/FbTk/ImageImlib2.cc10
1 files 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 {
53 53
54ImageImlib2::ImageImlib2() { 54ImageImlib2::ImageImlib2() {
55 55
56 // lets have a 2mb cache inside imlib, holds
57 // uncompressed images
58 imlib_set_cache_size(2048 * 1024);
59
60 // TODO: this are the potential candidates, 56 // TODO: this are the potential candidates,
61 // choose only sane ones. open for discussion 57 // choose only sane ones. open for discussion
62 static const char* format_list[] = { 58 static const char* format_list[] = {
@@ -90,12 +86,16 @@ PixmapWithMask *ImageImlib2::load(const std::string &filename, int screen_num) c
90 86
91 Imlib_Context new_context = imlib_context_new(); 87 Imlib_Context new_context = imlib_context_new();
92 imlib_context_push(new_context); 88 imlib_context_push(new_context);
93 89
94 imlib_context_set_display(dpy); 90 imlib_context_set_display(dpy);
95 imlib_context_set_visual(DefaultVisual(dpy, screen_num)); 91 imlib_context_set_visual(DefaultVisual(dpy, screen_num));
96 imlib_context_set_colormap(DefaultColormap(dpy, screen_num)); 92 imlib_context_set_colormap(DefaultColormap(dpy, screen_num));
97 imlib_context_set_drawable(RootWindow(dpy, screen_num)); 93 imlib_context_set_drawable(RootWindow(dpy, screen_num));
98 94
95 // lets have a 2mb cache inside imlib, holds
96 // uncompressed images
97 imlib_set_cache_size(2048 * 1024);
98
99 imlib_context_pop(); 99 imlib_context_pop();
100 100
101 contexts[screen_num] = new_context; 101 contexts[screen_num] = new_context;