reconfig timer back, needs to have a timer so we can reconfig fluxbox save in the next event round, see comments...
This commit is contained in:
parent
498f852907
commit
9b88b1f2c7
2 changed files with 22 additions and 10 deletions
|
@ -22,7 +22,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// 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"
|
#include "fluxbox.hh"
|
||||||
|
|
||||||
|
@ -409,7 +409,7 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
|
||||||
m_focus_revert_screen(0)
|
m_focus_revert_screen(0)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
if (s_singleton != 0)
|
if (s_singleton != 0)
|
||||||
throw string("Fatal! There can only one instance of fluxbox class.");
|
throw string("Fatal! There can only one instance of fluxbox class.");
|
||||||
|
|
||||||
|
@ -438,6 +438,19 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
|
||||||
sigh.registerHandler(SIGHUP, this);
|
sigh.registerHandler(SIGHUP, this);
|
||||||
sigh.registerHandler(SIGUSR1, this);
|
sigh.registerHandler(SIGUSR1, this);
|
||||||
sigh.registerHandler(SIGUSR2, 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();
|
Display *disp = FbTk::App::instance()->display();
|
||||||
|
|
||||||
|
@ -931,9 +944,8 @@ void Fluxbox::handleEvent(XEvent * const e) {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
cerr<<__FILE__<<"("<<__FUNCTION__<<") Focus out is not a FluxboxWindow !!"<<endl;
|
cerr<<__FILE__<<"("<<__FUNCTION__<<") Focus out is not a FluxboxWindow !!"<<endl;
|
||||||
#endif // DEBUG
|
#endif // DEBUG
|
||||||
} else if (winclient && winclient == m_focused_window) {
|
} else if (winclient && winclient == m_focused_window)
|
||||||
setFocusedWindow(0);
|
setFocusedWindow(0);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ClientMessage:
|
case ClientMessage:
|
||||||
|
@ -1749,8 +1761,7 @@ void Fluxbox::reload_rc() {
|
||||||
|
|
||||||
void Fluxbox::reconfigure() {
|
void Fluxbox::reconfigure() {
|
||||||
m_reconfigure_wait = true;
|
m_reconfigure_wait = true;
|
||||||
|
m_reconfig_timer.start();
|
||||||
timed_reconfigure();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1802,8 +1813,7 @@ void Fluxbox::checkMenu() {
|
||||||
|
|
||||||
void Fluxbox::rereadMenu() {
|
void Fluxbox::rereadMenu() {
|
||||||
m_reread_menu_wait = true;
|
m_reread_menu_wait = true;
|
||||||
|
m_reconfig_timer.start();
|
||||||
timed_reconfigure();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// 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
|
#ifndef FLUXBOX_HH
|
||||||
#define FLUXBOX_HH
|
#define FLUXBOX_HH
|
||||||
|
@ -301,6 +301,8 @@ private:
|
||||||
int m_argc;
|
int m_argc;
|
||||||
XEvent m_last_event;
|
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;
|
std::auto_ptr<Keys> m_key;
|
||||||
|
|
||||||
//default arguments for titlebar left and right
|
//default arguments for titlebar left and right
|
||||||
|
|
Loading…
Reference in a new issue