From 1ef653cd9333aabcdecb4e69b3797edb46bf0d42 Mon Sep 17 00:00:00 2001 From: markt Date: Sun, 13 Aug 2006 00:25:09 +0000 Subject: little hack to make sure background only loads once symptom of a deeper problem with loading styles --- src/RootTheme.cc | 6 ++++++ src/RootTheme.hh | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/RootTheme.cc b/src/RootTheme.cc index 61c7b65..6847fc2 100644 --- a/src/RootTheme.cc +++ b/src/RootTheme.cc @@ -109,6 +109,7 @@ RootTheme::RootTheme(const std::string &root_command, m_opgc(RootWindow(FbTk::App::instance()->display(), image_control.screenNumber())), m_root_command(root_command), m_image_ctrl(image_control), + m_already_set(false), m_background_loaded(true) { Display *disp = FbTk::App::instance()->display(); @@ -137,6 +138,11 @@ bool RootTheme::fallback(FbTk::ThemeItem_base &item) { void RootTheme::reconfigTheme() { _FB_USES_NLS; + if (m_already_set) + return; + else + m_already_set = true; + // if user specified background in the config then use it // instead of style background if (!m_root_command.empty()) { diff --git a/src/RootTheme.hh b/src/RootTheme.hh index 9b45d60..7c1f8b5 100644 --- a/src/RootTheme.hh +++ b/src/RootTheme.hh @@ -51,7 +51,8 @@ public: bool fallback(FbTk::ThemeItem_base &item); void reconfigTheme(); - void setLoaded() { m_background_loaded = true; } + // little hack to deal with reconfigures -- should be fixed + void setLoaded() { m_background_loaded = true; m_already_set = false; } GC opGC() const { return m_opgc.gc(); } @@ -68,6 +69,7 @@ private: const std::string &m_root_command; FbTk::ImageControl &m_image_ctrl; ///< image control for rendering background texture bool m_background_loaded; ///< whether or not the background is present in the style file + bool m_already_set; }; -- cgit v0.11.2