little hack to make sure background only loads once

symptom of a deeper problem with loading styles
This commit is contained in:
markt 2006-08-13 00:25:09 +00:00
parent 2e7fd56817
commit 1ef653cd93
2 changed files with 9 additions and 1 deletions

View file

@ -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()) {

View file

@ -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;
};