was ending up using the wrong cache items. now i find and release it every time a string is drawn
Dana Jansens danakj@orodu.net
3 files changed,
8 insertions(+),
16 deletions(-)
M
src/Font.cc
→
src/Font.cc
@@ -61,9 +61,7 @@ _xftfont(0),
#endif // XFT _font(0), _fontset(0), - _fontset_extents(0), - _cache(0), - _item(0) { + _fontset_extents(0) { _valid = init(); }@@ -76,9 +74,7 @@ _xftfont(0),
#endif // XFT _font(0), _fontset(0), - _fontset_extents(0), - _cache(0), - _item(0) { + _fontset_extents(0) { string int_xlfd; if (xlfd.empty()) int_xlfd = _fallback_font;@@ -160,9 +156,6 @@ if (i18n.multibyte() && _fontset)
XFreeFontSet(_display, _fontset); if (_font) XFreeFont(_display, _font); - - if (_item) - _cache->release(_item); }@@ -262,10 +255,8 @@ return;
} #endif // XFT - if (! _cache) - _cache = color.display()->gcCache(); - if (! _item) - _item = _cache->find(color, _font, GXcopy, ClipByChildren); + BGCCache *_cache = color.display()->gcCache(); + BGCCacheItem *_item = _cache->find(color, _font, GXcopy, ClipByChildren); assert(_cache); assert(_item);@@ -278,6 +269,8 @@ else
XDrawString(_display, d, _item->gc(), x, _font->ascent + y, string.c_str(), string.size()); + + _cache->release(_item); }
M
src/Font.hh
→
src/Font.hh
@@ -87,9 +87,6 @@ bool init(const std::string &xlfd = "");
bool createFont(void); bool parseFontString(const std::string &xlfd); - mutable BGCCache *_cache; - mutable BGCCacheItem *_item; - bool _valid; public: