summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/RootTheme.cc12
-rw-r--r--src/RootTheme.hh4
-rw-r--r--src/Screen.cc3
3 files changed, 12 insertions, 7 deletions
diff --git a/src/RootTheme.cc b/src/RootTheme.cc
index afe0ca0..1e54368 100644
--- a/src/RootTheme.cc
+++ b/src/RootTheme.cc
@@ -25,6 +25,7 @@
25 25
26#include "FbRootWindow.hh" 26#include "FbRootWindow.hh"
27#include "FbCommands.hh" 27#include "FbCommands.hh"
28#include "Screen.hh"
28 29
29#include "FbTk/App.hh" 30#include "FbTk/App.hh"
30#include "FbTk/Font.hh" 31#include "FbTk/Font.hh"
@@ -141,8 +142,9 @@ private:
141}; 142};
142 143
143 144
144RootTheme::RootTheme(FbTk::ImageControl &image_control): 145RootTheme::RootTheme(FbTk::ImageControl &image_control, BScreen *scrn):
145 FbTk::Theme(image_control.screenNumber()), 146 FbTk::Theme(image_control.screenNumber()),
147 m_screen(scrn),
146 m_background(new BackgroundItem(*this, "background", "Background")), 148 m_background(new BackgroundItem(*this, "background", "Background")),
147 m_opgc(RootWindow(FbTk::App::instance()->display(), image_control.screenNumber())), 149 m_opgc(RootWindow(FbTk::App::instance()->display(), image_control.screenNumber())),
148 m_image_ctrl(image_control) { 150 m_image_ctrl(image_control) {
@@ -182,11 +184,9 @@ void RootTheme::reconfigTheme() {
182 return; 184 return;
183 } 185 }
184 186
185 if (!m_background->changed()) 187 if (!m_background->changed() || !m_screen)
186 return; 188 return;
187 189
188 m_background->setApplied();
189
190 // style doesn't wish to change the background 190 // style doesn't wish to change the background
191 if (strstr(m_background->options().c_str(), "none") != 0) 191 if (strstr(m_background->options().c_str(), "none") != 0)
192 return; 192 return;
@@ -196,7 +196,9 @@ void RootTheme::reconfigTheme() {
196 // 196 //
197 197
198 // root window helper 198 // root window helper
199 FbRootWindow rootwin(screenNum()); 199 FbRootWindow &rootwin = m_screen->rootWindow();
200
201 m_background->setApplied();
200 202
201 // handle background option in style 203 // handle background option in style
202 std::string filename = m_background->filename(); 204 std::string filename = m_background->filename();
diff --git a/src/RootTheme.hh b/src/RootTheme.hh
index abfea7c..63be8b0 100644
--- a/src/RootTheme.hh
+++ b/src/RootTheme.hh
@@ -33,6 +33,7 @@
33#include <string> 33#include <string>
34 34
35class BackgroundItem; 35class BackgroundItem;
36class BScreen;
36 37
37namespace FbTk { 38namespace FbTk {
38class ResourceManager; 39class ResourceManager;
@@ -45,7 +46,7 @@ public:
45 /// constructor 46 /// constructor
46 /// @param resmanager resource manager for finding specific resources 47 /// @param resmanager resource manager for finding specific resources
47 /// @param image_control for rendering background texture 48 /// @param image_control for rendering background texture
48 RootTheme(FbTk::ImageControl &image_control); 49 RootTheme(FbTk::ImageControl &image_control, BScreen *scrn = 0);
49 ~RootTheme(); 50 ~RootTheme();
50 51
51 bool fallback(FbTk::ThemeItem_base &item); 52 bool fallback(FbTk::ThemeItem_base &item);
@@ -61,6 +62,7 @@ public:
61 } 62 }
62 63
63private: 64private:
65 BScreen *m_screen;
64 BackgroundItem *m_background;///< background image/texture 66 BackgroundItem *m_background;///< background image/texture
65 FbTk::GContext m_opgc; 67 FbTk::GContext m_opgc;
66 FbTk::ImageControl &m_image_ctrl; ///< image control for rendering background texture 68 FbTk::ImageControl &m_image_ctrl; ///< image control for rendering background texture
diff --git a/src/Screen.cc b/src/Screen.cc
index 3f3daf9..9a3ef31 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -439,7 +439,8 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
439 cmd.execute(); 439 cmd.execute();
440 } 440 }
441 441
442 m_root_theme.reset(new RootTheme(imageControl())); 442 m_root_theme.reset(new RootTheme(imageControl(), this));
443 m_root_theme->reconfigTheme();
443 444
444 m_windowtheme->setFocusedAlpha(*resource.focused_alpha); 445 m_windowtheme->setFocusedAlpha(*resource.focused_alpha);
445 m_windowtheme->setUnfocusedAlpha(*resource.unfocused_alpha); 446 m_windowtheme->setUnfocusedAlpha(*resource.unfocused_alpha);