all repos — fluxbox @ 9b88b1f2c7e2da1ec6a47518ded37c0eab36e738

custom fork of the fluxbox windowmanager

reconfig timer back, needs to have a timer so we can reconfig fluxbox save in the next event round, see comments...
fluxgen fluxgen
commit

9b88b1f2c7e2da1ec6a47518ded37c0eab36e738

parent

498f8529077a5ab6642befa3b21d6bc360fdcd18

2 files changed, 22 insertions(+), 10 deletions(-)

jump to
M src/fluxbox.ccsrc/fluxbox.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: fluxbox.cc,v 1.209 2003/12/19 03:58:36 fluxgen Exp $ +// $Id: fluxbox.cc,v 1.210 2003/12/19 13:37:28 fluxgen Exp $ #include "fluxbox.hh"

@@ -409,7 +409,7 @@ m_RC_INIT_FILE("init"),

m_focus_revert_screen(0) { - + if (s_singleton != 0) throw string("Fatal! There can only one instance of fluxbox class.");

@@ -438,6 +438,19 @@ sigh.registerHandler(SIGCHLD, this);

sigh.registerHandler(SIGHUP, this); sigh.registerHandler(SIGUSR1, this); sigh.registerHandler(SIGUSR2, this); + // + // setup timer + // This timer is used to we can issue a safe reconfig command. + // Because when the command is executed we shouldn't do reconfig directly + // because it could affect ongoing menu stuff so we need to reconfig in + // the next event "round". + FbTk::RefCount<FbTk::Command> reconfig_cmd(new FbTk::SimpleCommand<Fluxbox>(*this, &Fluxbox::timed_reconfigure)); + timeval to; + to.tv_sec = 0; + to.tv_usec = 1; + m_reconfig_timer.setTimeout(to); + m_reconfig_timer.setCommand(reconfig_cmd); + m_reconfig_timer.fireOnce(true); Display *disp = FbTk::App::instance()->display();

@@ -931,9 +944,8 @@ if (winclient == 0 && FbTk::Menu::focused() == 0) {

#ifdef DEBUG cerr<<__FILE__<<"("<<__FUNCTION__<<") Focus out is not a FluxboxWindow !!"<<endl; #endif // DEBUG - } else if (winclient && winclient == m_focused_window) { - setFocusedWindow(0); - } + } else if (winclient && winclient == m_focused_window) + setFocusedWindow(0); } break; case ClientMessage:

@@ -1749,8 +1761,7 @@

void Fluxbox::reconfigure() { m_reconfigure_wait = true; - - timed_reconfigure(); + m_reconfig_timer.start(); }

@@ -1802,8 +1813,7 @@

void Fluxbox::rereadMenu() { m_reread_menu_wait = true; - - timed_reconfigure(); + m_reconfig_timer.start(); }
M src/fluxbox.hhsrc/fluxbox.hh

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: fluxbox.hh,v 1.76 2003/12/19 00:35:08 fluxgen Exp $ +// $Id: fluxbox.hh,v 1.77 2003/12/19 13:36:21 fluxgen Exp $ #ifndef FLUXBOX_HH #define FLUXBOX_HH

@@ -300,6 +300,8 @@ std::string m_rc_file; ///< resource filename

char **m_argv; int m_argc; XEvent m_last_event; + + FbTk::Timer m_reconfig_timer; ///< when we execute reconfig command we must wait at least to next event round std::auto_ptr<Keys> m_key;