little hack to make sure background only loads once symptom of a deeper problem with loading styles
markt markt
2 files changed,
9 insertions(+),
1 deletions(-)
M
src/RootTheme.cc
→
src/RootTheme.cc
@@ -109,6 +109,7 @@ m_background(new BackgroundItem(*this, "background", "Background")),
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();@@ -136,6 +137,11 @@ }
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
M
src/RootTheme.hh
→
src/RootTheme.hh
@@ -51,7 +51,8 @@ ~RootTheme();
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 @@ FbTk::GContext m_opgc;
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; };