aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-12-19 13:37:28 (GMT)
committerfluxgen <fluxgen>2003-12-19 13:37:28 (GMT)
commit9b88b1f2c7e2da1ec6a47518ded37c0eab36e738 (patch)
treee3a3a7b592f86ed16deb32374b3494818141fea0
parent498f8529077a5ab6642befa3b21d6bc360fdcd18 (diff)
downloadfluxbox-9b88b1f2c7e2da1ec6a47518ded37c0eab36e738.zip
fluxbox-9b88b1f2c7e2da1ec6a47518ded37c0eab36e738.tar.bz2
reconfig timer back, needs to have a timer so we can reconfig fluxbox save in the next event round, see comments...
-rw-r--r--src/fluxbox.cc28
-rw-r--r--src/fluxbox.hh4
2 files changed, 22 insertions, 10 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
diff --git a/src/fluxbox.hh b/src/fluxbox.hh
index 7f1c43f..054af43 100644
--- a/src/fluxbox.hh
+++ b/src/fluxbox.hh
@@ -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.hh,v 1.76 2003/12/19 00:35:08 fluxgen Exp $ 25// $Id: fluxbox.hh,v 1.77 2003/12/19 13:36:21 fluxgen Exp $
26 26
27#ifndef FLUXBOX_HH 27#ifndef FLUXBOX_HH
28#define FLUXBOX_HH 28#define FLUXBOX_HH
@@ -301,6 +301,8 @@ private:
301 int m_argc; 301 int m_argc;
302 XEvent m_last_event; 302 XEvent m_last_event;
303 303
304 FbTk::Timer m_reconfig_timer; ///< when we execute reconfig command we must wait at least to next event round
305
304 std::auto_ptr<Keys> m_key; 306 std::auto_ptr<Keys> m_key;
305 307
306 //default arguments for titlebar left and right 308 //default arguments for titlebar left and right