little hack to make sure background only loads once
symptom of a deeper problem with loading styles
This commit is contained in:
parent
2e7fd56817
commit
1ef653cd93
2 changed files with 9 additions and 1 deletions
|
@ -109,6 +109,7 @@ RootTheme::RootTheme(const std::string &root_command,
|
||||||
m_opgc(RootWindow(FbTk::App::instance()->display(), image_control.screenNumber())),
|
m_opgc(RootWindow(FbTk::App::instance()->display(), image_control.screenNumber())),
|
||||||
m_root_command(root_command),
|
m_root_command(root_command),
|
||||||
m_image_ctrl(image_control),
|
m_image_ctrl(image_control),
|
||||||
|
m_already_set(false),
|
||||||
m_background_loaded(true) {
|
m_background_loaded(true) {
|
||||||
|
|
||||||
Display *disp = FbTk::App::instance()->display();
|
Display *disp = FbTk::App::instance()->display();
|
||||||
|
@ -137,6 +138,11 @@ bool RootTheme::fallback(FbTk::ThemeItem_base &item) {
|
||||||
void RootTheme::reconfigTheme() {
|
void RootTheme::reconfigTheme() {
|
||||||
_FB_USES_NLS;
|
_FB_USES_NLS;
|
||||||
|
|
||||||
|
if (m_already_set)
|
||||||
|
return;
|
||||||
|
else
|
||||||
|
m_already_set = true;
|
||||||
|
|
||||||
// if user specified background in the config then use it
|
// if user specified background in the config then use it
|
||||||
// instead of style background
|
// instead of style background
|
||||||
if (!m_root_command.empty()) {
|
if (!m_root_command.empty()) {
|
||||||
|
|
|
@ -51,7 +51,8 @@ public:
|
||||||
|
|
||||||
bool fallback(FbTk::ThemeItem_base &item);
|
bool fallback(FbTk::ThemeItem_base &item);
|
||||||
void reconfigTheme();
|
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(); }
|
GC opGC() const { return m_opgc.gc(); }
|
||||||
|
|
||||||
|
@ -68,6 +69,7 @@ private:
|
||||||
const std::string &m_root_command;
|
const std::string &m_root_command;
|
||||||
FbTk::ImageControl &m_image_ctrl; ///< image control for rendering background texture
|
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_background_loaded; ///< whether or not the background is present in the style file
|
||||||
|
bool m_already_set;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue