fix parentrelative background, and some tidying
simonb simonb
5 files changed,
18 insertions(+),
8 deletions(-)
M
src/FbTk/App.cc
→
src/FbTk/App.cc
@@ -59,8 +59,7 @@ if (m_display != 0) {
Font::shutdown(); Image::shutdown(); - FbStringUtil::shutdown(); - + XCloseDisplay(m_display); m_display = 0; }
M
src/FbTk/FbString.cc
→
src/FbTk/FbString.cc
@@ -56,10 +56,8 @@ #endif // HAVE_ICONV
/// Initialise all of the iconv conversion descriptors void init() { - static bool s_init = false; - if (s_init) + if (iconv_convs != 0) return; - s_init = true; iconv_convs = new iconv_t[CONVSIZE];@@ -92,6 +90,8 @@
} void shutdown() { + if (iconv_convs == 0) + return; #ifdef HAVE_ICONV for (int i=0; i < CONVSIZE; ++i) if (iconv_convs[i] != (iconv_t)(-1))@@ -99,7 +99,7 @@ iconv_close(iconv_convs[i]);
#endif // HAVE_ICONV delete[] iconv_convs; - + iconv_convs = 0; }
M
src/FbTk/FbWindow.cc
→
src/FbTk/FbWindow.cc
@@ -249,13 +249,19 @@ }
void FbWindow::clear() { XClearWindow(display(), m_window); + if (m_lastbg_pm == ParentRelative && m_renderer) + m_renderer->renderForeground(*this, *this); + } void FbWindow::clearArea(int x, int y, unsigned int width, unsigned int height, bool exposures) { // TODO: probably could call renderForeground here (with x,y,w,h) - XClearArea(display(), window(), x, y, width, height, exposures); + if (m_lastbg_pm == ParentRelative && m_renderer) + FbWindow::clear(); + else + XClearArea(display(), window(), x, y, width, height, exposures); } // If override_is_offset, then dest_override is a pixmap located at the_x, the_y
M
src/main.cc
→
src/main.cc
@@ -303,6 +303,8 @@ cout.rdbuf(outbuf);
if (errbuf != 0) cerr.rdbuf(errbuf); + FbTk::FbStringUtil::shutdown(); + if (restarting) { const char *arg = restart_argument.c_str(); if (arg) {