aboutsummaryrefslogtreecommitdiff
path: root/src/fluxbox.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/fluxbox.cc')
-rw-r--r--src/fluxbox.cc28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index c831713..4210f47 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: fluxbox.cc,v 1.209 2003/12/19 03:58:36 fluxgen Exp $ 25// $Id: fluxbox.cc,v 1.210 2003/12/19 13:37:28 fluxgen Exp $
26 26
27#include "fluxbox.hh" 27#include "fluxbox.hh"
28 28
@@ -409,7 +409,7 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
409 m_focus_revert_screen(0) 409 m_focus_revert_screen(0)
410{ 410{
411 411
412 412
413 if (s_singleton != 0) 413 if (s_singleton != 0)
414 throw string("Fatal! There can only one instance of fluxbox class."); 414 throw string("Fatal! There can only one instance of fluxbox class.");
415 415
@@ -438,6 +438,19 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
438 sigh.registerHandler(SIGHUP, this); 438 sigh.registerHandler(SIGHUP, this);
439 sigh.registerHandler(SIGUSR1, this); 439 sigh.registerHandler(SIGUSR1, this);
440 sigh.registerHandler(SIGUSR2, this); 440 sigh.registerHandler(SIGUSR2, this);
441 //
442 // setup timer
443 // This timer is used to we can issue a safe reconfig command.
444 // Because when the command is executed we shouldn't do reconfig directly
445 // because it could affect ongoing menu stuff so we need to reconfig in
446 // the next event "round".
447 FbTk::RefCount<FbTk::Command> reconfig_cmd(new FbTk::SimpleCommand<Fluxbox>(*this, &Fluxbox::timed_reconfigure));
448 timeval to;
449 to.tv_sec = 0;
450 to.tv_usec = 1;
451 m_reconfig_timer.setTimeout(to);
452 m_reconfig_timer.setCommand(reconfig_cmd);
453 m_reconfig_timer.fireOnce(true);
441 454
442 Display *disp = FbTk::App::instance()->display(); 455 Display *disp = FbTk::App::instance()->display();
443 456
@@ -931,9 +944,8 @@ void Fluxbox::handleEvent(XEvent * const e) {
931#ifdef DEBUG 944#ifdef DEBUG
932 cerr<<__FILE__<<"("<<__FUNCTION__<<") Focus out is not a FluxboxWindow !!"<<endl; 945 cerr<<__FILE__<<"("<<__FUNCTION__<<") Focus out is not a FluxboxWindow !!"<<endl;
933#endif // DEBUG 946#endif // DEBUG
934 } else if (winclient && winclient == m_focused_window) { 947 } else if (winclient && winclient == m_focused_window)
935 setFocusedWindow(0); 948 setFocusedWindow(0);
936 }
937 } 949 }
938 break; 950 break;
939 case ClientMessage: 951 case ClientMessage:
@@ -1749,8 +1761,7 @@ void Fluxbox::reload_rc() {
1749 1761
1750void Fluxbox::reconfigure() { 1762void Fluxbox::reconfigure() {
1751 m_reconfigure_wait = true; 1763 m_reconfigure_wait = true;
1752 1764 m_reconfig_timer.start();
1753 timed_reconfigure();
1754} 1765}
1755 1766
1756 1767
@@ -1802,8 +1813,7 @@ void Fluxbox::checkMenu() {
1802 1813
1803void Fluxbox::rereadMenu() { 1814void Fluxbox::rereadMenu() {
1804 m_reread_menu_wait = true; 1815 m_reread_menu_wait = true;
1805 1816 m_reconfig_timer.start();
1806 timed_reconfigure();
1807} 1817}
1808 1818
1809 1819