aboutsummaryrefslogtreecommitdiff
path: root/src/fluxbox.cc
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-07-30 10:21:53 (GMT)
committerPavel Labath <pavelo@centrum.sk>2013-02-18 21:04:25 (GMT)
commit54ed350776d4f78de9aabb0273f085aa7c2ce124 (patch)
tree994cd8b01e4423c3e535b54a41e30238fce1b10b /src/fluxbox.cc
parentfe7a9bf5b0d59d25ef87ca6ccf47e40055596b84 (diff)
downloadfluxbox_pavel-54ed350776d4f78de9aabb0273f085aa7c2ce124.zip
fluxbox_pavel-54ed350776d4f78de9aabb0273f085aa7c2ce124.tar.bz2
Create a completely new lua state upon USR2 reconfigure
This way, global variables set by the scripts don't persist between hard reconfigures. I also cleaned up the reconfig-handling code in fluxbox.cc. Instead of three reconfig functions (real_reconfig, timed_reconfig, reconfig) we have just one.
Diffstat (limited to 'src/fluxbox.cc')
-rw-r--r--src/fluxbox.cc28
1 files changed, 8 insertions, 20 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index e293606..f66d83d 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.cc
@@ -310,7 +310,7 @@ Fluxbox::Fluxbox(int argc, char **argv,
310 // Because when the command is executed we shouldn't do reconfig directly 310 // Because when the command is executed we shouldn't do reconfig directly
311 // because it could affect ongoing menu stuff so we need to reconfig in 311 // because it could affect ongoing menu stuff so we need to reconfig in
312 // the next event "round". 312 // the next event "round".
313 FbTk::RefCount<FbTk::Command<void> > reconfig_cmd(new FbTk::SimpleCommand<Fluxbox>(*this, &Fluxbox::timed_reconfigure)); 313 FbTk::RefCount<FbTk::Command<void> > reconfig_cmd(new FbTk::SimpleCommand<Fluxbox>(*this, &Fluxbox::reconfigure));
314 m_reconfig_timer.setTimeout(1); 314 m_reconfig_timer.setTimeout(1);
315 m_reconfig_timer.setCommand(reconfig_cmd); 315 m_reconfig_timer.setCommand(reconfig_cmd);
316 m_reconfig_timer.fireOnce(true); 316 m_reconfig_timer.fireOnce(true);
@@ -438,8 +438,6 @@ Fluxbox::Fluxbox(int argc, char **argv,
438 //XSynchronize(disp, False); 438 //XSynchronize(disp, False);
439 sync(false); 439 sync(false);
440 440
441 m_reconfigure_wait = false;
442
443 ungrab(); 441 ungrab();
444 442
445 m_starting = false; 443 m_starting = false;
@@ -905,7 +903,7 @@ void Fluxbox::handleSignal(int signum) {
905 load_rc(); 903 load_rc();
906 break; 904 break;
907 case SIGUSR2: 905 case SIGUSR2:
908 reconfigure(); 906 m_reconfig_timer.start();
909 break; 907 break;
910#endif 908#endif
911 case SIGSEGV: 909 case SIGSEGV:
@@ -1190,17 +1188,6 @@ void Fluxbox::load_rc() {
1190 *m_rc_stylefile = DEFAULTSTYLE; 1188 *m_rc_stylefile = DEFAULTSTYLE;
1191} 1189}
1192 1190
1193void Fluxbox::reconfigure() {
1194 load_rc();
1195 m_reconfigure_wait = true;
1196 m_reconfig_timer.start();
1197}
1198
1199
1200void Fluxbox::real_reconfigure() {
1201 STLUtil::forAll(m_screen_list, mem_fun(&BScreen::reconfigure));
1202}
1203
1204BScreen *Fluxbox::findScreen(int id) { 1191BScreen *Fluxbox::findScreen(int id) {
1205 1192
1206 BScreen* result = 0; 1193 BScreen* result = 0;
@@ -1213,11 +1200,12 @@ BScreen *Fluxbox::findScreen(int id) {
1213 return result; 1200 return result;
1214} 1201}
1215 1202
1216void Fluxbox::timed_reconfigure() { 1203void Fluxbox::reconfigure() {
1217 if (m_reconfigure_wait) 1204 std::auto_ptr<FbTk::Lua> t = m_l;
1218 real_reconfigure(); 1205 m_l.reset(new Lua);
1219 1206 m_resourcemanager.setLua(*m_l);
1220 m_reconfigure_wait = false; 1207 load_rc();
1208 STLUtil::forAll(m_screen_list, mem_fun(&BScreen::reconfigure));
1221} 1209}
1222 1210
1223void Fluxbox::revertFocus() { 1211void Fluxbox::revertFocus() {