X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=util%2Fepist%2Fkeytree.cc;h=30efa1be2ecc1a4f5ae6785a0a9f329aa1e7ddb9;hb=572acce581f4b8799db661ed7ab0007de0393a09;hp=e9fa2cab49c860bd65604996eb2539f8e008ba13;hpb=bd05f7ec58f3e1f5839c372ad4fb007a8d8866f5;p=chaz%2Fopenbox diff --git a/util/epist/keytree.cc b/util/epist/keytree.cc index e9fa2cab..30efa1be 100644 --- a/util/epist/keytree.cc +++ b/util/epist/keytree.cc @@ -82,7 +82,7 @@ void keytree::ungrabDefaults(screen *scr) { 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() ); } @@ -175,6 +175,14 @@ void keytree::addAction(Action::ActionType action, unsigned int mask, 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())), @@ -212,7 +220,9 @@ void keytree::setCurrentNodeProps(Action::ActionType action, unsigned int mask, 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)