From 4afe5499b20ca321f2ead44e46b14f9df2db5339 Mon Sep 17 00:00:00 2001 From: simonb Date: Mon, 22 May 2006 15:09:21 +0000 Subject: fix parentrelative background, and some tidying --- ChangeLog | 5 ++++- src/FbTk/App.cc | 3 +-- src/FbTk/FbString.cc | 8 ++++---- src/FbTk/FbWindow.cc | 8 +++++++- src/main.cc | 2 ++ 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0ec5f8c..2fcec37 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ -(Format: Year/Month/Day) + (Format: Year/Month/Day) Changes for 0.9.16: +*06/05/22: + * Fix handling of ParentRelative background (Simon) + FbWindow.cc *06/05/21: * Fix build on cygwin (iconv const error) (Simon) FbTk/FbString.cc diff --git a/src/FbTk/App.cc b/src/FbTk/App.cc index 0b773c4..d60f95b 100644 --- a/src/FbTk/App.cc +++ b/src/FbTk/App.cc @@ -59,8 +59,7 @@ App::~App() { Font::shutdown(); Image::shutdown(); - FbStringUtil::shutdown(); - + XCloseDisplay(m_display); m_display = 0; } diff --git a/src/FbTk/FbString.cc b/src/FbTk/FbString.cc index c11b11d..26eb058 100644 --- a/src/FbTk/FbString.cc +++ b/src/FbTk/FbString.cc @@ -56,10 +56,8 @@ static int iconv_convs[CONVSIZE]; /// 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 init() { } 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 @@ void shutdown() { #endif // HAVE_ICONV delete[] iconv_convs; - + iconv_convs = 0; } diff --git a/src/FbTk/FbWindow.cc b/src/FbTk/FbWindow.cc index 2c34fa1..b996edc 100644 --- a/src/FbTk/FbWindow.cc +++ b/src/FbTk/FbWindow.cc @@ -249,13 +249,19 @@ void FbWindow::setEventMask(long mask) { 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 diff --git a/src/main.cc b/src/main.cc index d7261e5..a8b7699 100644 --- a/src/main.cc +++ b/src/main.cc @@ -303,6 +303,8 @@ int main(int argc, char **argv) { if (errbuf != 0) cerr.rdbuf(errbuf); + FbTk::FbStringUtil::shutdown(); + if (restarting) { const char *arg = restart_argument.c_str(); if (arg) { -- cgit v0.11.2