aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/FbCommands.cc10
-rw-r--r--src/RootCmdMenuItem.cc3
-rw-r--r--src/Screen.cc5
-rw-r--r--src/StyleMenuItem.cc2
-rw-r--r--src/fluxbox.cc8
-rw-r--r--src/fluxbox.hh5
6 files changed, 14 insertions, 19 deletions
diff --git a/src/FbCommands.cc b/src/FbCommands.cc
index b7bd309..7d6b994 100644
--- a/src/FbCommands.cc
+++ b/src/FbCommands.cc
@@ -246,8 +246,8 @@ void ReconfigureFluxboxCmd::execute() {
246REGISTER_COMMAND(reloadstyle, FbCommands::ReloadStyleCmd, void); 246REGISTER_COMMAND(reloadstyle, FbCommands::ReloadStyleCmd, void);
247 247
248void ReloadStyleCmd::execute() { 248void ReloadStyleCmd::execute() {
249 SetStyleCmd cmd(Fluxbox::instance()->getStyleFilename()); 249 // setting the value will trigger a reload
250 cmd.execute(); 250 *Fluxbox::instance()->getStyleResource() = *Fluxbox::instance()->getStyleResource();
251} 251}
252 252
253REGISTER_COMMAND_WITH_ARGS(setstyle, FbCommands::SetStyleCmd, void); 253REGISTER_COMMAND_WITH_ARGS(setstyle, FbCommands::SetStyleCmd, void);
@@ -257,11 +257,7 @@ SetStyleCmd::SetStyleCmd(const string &filename):m_filename(filename) {
257} 257}
258 258
259void SetStyleCmd::execute() { 259void SetStyleCmd::execute() {
260 if (FbTk::ThemeManager::instance().load(m_filename, 260 *Fluxbox::instance()->getStyleResource() = m_filename;
261 Fluxbox::instance()->getStyleOverlayFilename())) {
262 Fluxbox::instance()->saveStyleFilename(m_filename.c_str());
263 Fluxbox::instance()->save_rc();
264 }
265} 261}
266 262
267REGISTER_COMMAND_WITH_ARGS(keymode, FbCommands::KeyModeCmd, void); 263REGISTER_COMMAND_WITH_ARGS(keymode, FbCommands::KeyModeCmd, void);
diff --git a/src/RootCmdMenuItem.cc b/src/RootCmdMenuItem.cc
index c3642ee..ce6d24a 100644
--- a/src/RootCmdMenuItem.cc
+++ b/src/RootCmdMenuItem.cc
@@ -43,6 +43,7 @@ RootCmdMenuItem::RootCmdMenuItem(const FbTk::FbString &label,
43 43
44 44
45bool RootCmdMenuItem::isSelected() const { 45bool RootCmdMenuItem::isSelected() const {
46 return Fluxbox::instance()->getStyleFilename() == m_filename; 46 // XXX how do we find out which is the current background?
47 return false;
47} 48}
48 49
diff --git a/src/Screen.cc b/src/Screen.cc
index 622ba55..6ba6a06 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -842,11 +842,6 @@ void BScreen::reconfigure() {
842 // notify objects that the screen is reconfigured 842 // notify objects that the screen is reconfigured
843 m_reconfigure_sig.emit(*this); 843 m_reconfigure_sig.emit(*this);
844 844
845 // Reload style
846 FbTk::ThemeManager::instance().load(fluxbox->getStyleFilename(),
847 fluxbox->getStyleOverlayFilename(),
848 m_root_theme->screenNum());
849
850 reconfigureTabs(); 845 reconfigureTabs();
851} 846}
852 847
diff --git a/src/StyleMenuItem.cc b/src/StyleMenuItem.cc
index 8e557a7..348d3c1 100644
--- a/src/StyleMenuItem.cc
+++ b/src/StyleMenuItem.cc
@@ -42,6 +42,6 @@ StyleMenuItem::StyleMenuItem(const FbTk::FbString &label, const std::string &fil
42 42
43 43
44bool StyleMenuItem::isSelected() const { 44bool StyleMenuItem::isSelected() const {
45 return Fluxbox::instance()->getStyleFilename() == m_filename; 45 return Fluxbox::instance()->getStyleResource().get() == m_filename;
46} 46}
47 47
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index 09aca1b..7f0f47a 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.cc
@@ -326,6 +326,7 @@ Fluxbox::Fluxbox(int argc, char **argv,
326#endif // HAVE_RANDR 326#endif // HAVE_RANDR
327 327
328 join(m_rc_pseudotrans.modifiedSig(), &FbTk::Transparent::usePseudoTransparent); 328 join(m_rc_pseudotrans.modifiedSig(), &FbTk::Transparent::usePseudoTransparent);
329 join(m_rc_stylefile.modifiedSig(), MemFunIgnoreArgs(*this, &Fluxbox::styleChanged));
329 330
330 load_rc(); 331 load_rc();
331 332
@@ -347,9 +348,6 @@ Fluxbox::Fluxbox(int argc, char **argv,
347#endif // HAVE_GETPID 348#endif // HAVE_GETPID
348 349
349 350
350 // setup theme manager to have our style file ready to be scanned
351 FbTk::ThemeManager::instance().load(getStyleFilename(), getStyleOverlayFilename());
352
353 // Create keybindings handler and load keys file 351 // Create keybindings handler and load keys file
354 // Note: this needs to be done before creating screens 352 // Note: this needs to be done before creating screens
355 m_key.reset(new Keys); 353 m_key.reset(new Keys);
@@ -1001,6 +999,10 @@ void Fluxbox::windowLayerChanged(FluxboxWindow &win) {
1001 CallMemFunWithRefArg<AtomHandler, FluxboxWindow&, void>(&AtomHandler::updateLayer, win)); 999 CallMemFunWithRefArg<AtomHandler, FluxboxWindow&, void>(&AtomHandler::updateLayer, win));
1002} 1000}
1003 1001
1002void Fluxbox::styleChanged() {
1003 FbTk::ThemeManager::instance().load(*getStyleResource(), getStyleOverlayFilename());
1004}
1005
1004void Fluxbox::attachSignals(FluxboxWindow &win) { 1006void Fluxbox::attachSignals(FluxboxWindow &win) {
1005 join(win.stateSig(), FbTk::MemFun(*this, &Fluxbox::windowStateChanged)); 1007 join(win.stateSig(), FbTk::MemFun(*this, &Fluxbox::windowStateChanged));
1006 join(win.workspaceSig(), FbTk::MemFun(*this, &Fluxbox::windowWorkspaceChanged)); 1008 join(win.workspaceSig(), FbTk::MemFun(*this, &Fluxbox::windowWorkspaceChanged));
diff --git a/src/fluxbox.hh b/src/fluxbox.hh
index 22b34bb..7d479ae 100644
--- a/src/fluxbox.hh
+++ b/src/fluxbox.hh
@@ -117,7 +117,7 @@ public:
117 FbTk::BoolResource &getPseudoTransResource() { return m_rc_pseudotrans; } 117 FbTk::BoolResource &getPseudoTransResource() { return m_rc_pseudotrans; }
118 118
119 Fluxbox::TabsAttachArea getTabsAttachArea() const { return *m_rc_tabs_attach_area; } 119 Fluxbox::TabsAttachArea getTabsAttachArea() const { return *m_rc_tabs_attach_area; }
120 const std::string &getStyleFilename() const { return *m_rc_stylefile; } 120 FbTk::StringResource &getStyleResource() { return m_rc_stylefile; }
121 const std::string &getStyleOverlayFilename() const { return *m_rc_styleoverlayfile; } 121 const std::string &getStyleOverlayFilename() const { return *m_rc_styleoverlayfile; }
122 122
123 const std::string &getMenuFilename() const { return *m_rc_menufile; } 123 const std::string &getMenuFilename() const { return *m_rc_menufile; }
@@ -138,7 +138,6 @@ public:
138 138
139 void shutdown(); 139 void shutdown();
140 void load_rc(BScreen &scr); 140 void load_rc(BScreen &scr);
141 void saveStyleFilename(const char *val) { m_rc_stylefile = (val == 0 ? "" : val); }
142 void saveWindowSearch(Window win, WinClient *winclient); 141 void saveWindowSearch(Window win, WinClient *winclient);
143 // some windows relate to the group, not the client, so we record separately 142 // some windows relate to the group, not the client, so we record separately
144 // searchWindow on these windows will give the active client in the group 143 // searchWindow on these windows will give the active client in the group
@@ -225,6 +224,8 @@ private:
225 void windowStateChanged(FluxboxWindow &win); 224 void windowStateChanged(FluxboxWindow &win);
226 /// Called when a window layer changes 225 /// Called when a window layer changes
227 void windowLayerChanged(FluxboxWindow &win); 226 void windowLayerChanged(FluxboxWindow &win);
227 /// Called when a style (or it's overlay) changes
228 void styleChanged();
228 229
229 std::auto_ptr<FbTk::Lua> m_l; 230 std::auto_ptr<FbTk::Lua> m_l;
230 std::auto_ptr<FbAtoms> m_fbatoms; 231 std::auto_ptr<FbAtoms> m_fbatoms;