aboutsummaryrefslogtreecommitdiff
path: root/src/tests/testSignals.cc
AgeCommit message (Collapse)AuthorFilesLines
2014-02-18Fix race condition on shutdownMathias Gumz1-172/+0
This commit fixes primarily a race condition that occurs when xinit(1) shuts down: by not acting properly fluxbox gets caught in an infinite loop. It caused bug #1100. xinit(1) sends a SIGHUP signal to all processes. fluxbox tries to shutdown itself properly by shutting down workspaces and screens. While doing that, the Xserver might be gone already. Additionally, fluxbox used to restart() itself on SIGHUP, which is clearly not the right thing to do when xinit(1) is about to end the session. So, fluxbox does this: * handling SIGHUP now shuts down fluxbox without clearing workspaces and screens. * A 2 second alarm() is triggered in Fluxbox::shutdown() as a last resort * XSetIOErrorHandler() is used to recognize the disconnect from the xserver. * SIGUSR1 is for restarting fluxbox, SIGUSR2 for reloading the config * FbTk/SignalHandler.cc/hh is gone; this unused abstraction served currently no real purpose. Signal handling is now done in main.cc * Unrelated to the issue itself src/main.cc was trimmed down quite a bit and the code (responsible for handling the command line interface) was moved to src/cli*
2011-05-10Remove Observers from testSignal.ccPavel Labath1-23/+0
2011-05-10Last round of simplification of Signal/Slot classesPavel Labath1-9/+9
- merged all the common stuff from 0,1,2,3 argument versions into one common base class - removed ReturnType template parameter as it was instantiated with "void" everywhere and the current ignores the return value of the callbacks anyway
2010-03-19Added SelectArg and MemFunSelectArg*Henrik Kinnunen1-1/+32
The MemFunSelectArg* functions can be used to select a specific argument from a signal. For example this would select the string argument as argument to the callback: Signal<void, int, float, string> signal; signal.connect(MemFunSelectArg2(obj, &Object::takesOneStringArg)); signal.emit(10, 3.14, "hello"); ... void Object::takesOneStringArg(const string& value) { ... }
2010-03-18Added FbTk::relaySignal, which relays new signals to old Subject type signals.Henrik Kinnunen1-1/+23
2010-03-18Added MemFunIgnoreArgs which ignores aditional arguments.Henrik Kinnunen1-1/+22
For example connecting a function that takes two arguments to a signal that emits three arguments: struct Functor { void show(int a, int b); }; Functor f; Signal<void, int, int, int> s3; s3.connect(MemFunIgnoreArgs(f, &Functor::show));
2008-09-18Added new Signal/Slot system in FbTkHenrik Kinnunen1-0/+121
This is suppose to replace the obsolete Subject/Observer classes. See the src/tests/testSignals.cc for basic usage.