// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
+#ifdef HAVE_CONFIG_H
+# include "../../config.h"
+#endif // HAVE_CONFIG_H
+
#include "keytree.hh"
#include "epist.hh"
#include "config.hh"
{
ChildList::const_iterator it, end = _head->children.end();
for (it = _head->children.begin(); it != end; ++it)
- if ( (*it)->action )
+ if ( (*it)->action && (*it)->action->type() != Action::toggleGrabs)
scr->ungrabKey( (*it)->action->keycode(), (*it)->action->modifierMask() );
}
string key, string arg)
{
keynode *tmp = new keynode;
+
+ if (action == Action::toggleGrabs && _current != _head) {
+ // the toggleGrabs key can only be set up as a root key, since if
+ // it was a chain key, we'd have to not ungrab the whole chain up
+ // to that key. which kinda defeats the purpose of this function.
+ return;
+ }
+
tmp->action = new Action(action,
XKeysymToKeycode(_display,
XStringToKeysym(key.c_str())),
void keytree::initialize(void)
{
- int tval = _epist->getConfig()->getNumberValue(Config::chainTimeout);
+ int tval = 0;
+
+ _epist->getConfig()->getValue(Config::chainTimeout, tval);
_timer = new BTimer(_epist, this);
if (tval <= 0)