]> Dogcows Code - chaz/openbox/blobdiff - util/epist/keytree.cc
toggleGrabs action added
[chaz/openbox] / util / epist / keytree.cc
index e9fa2cab49c860bd65604996eb2539f8e008ba13..6dcba312ccac832cd14128ea00b40d5a1e3447a0 100644 (file)
@@ -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())),
This page took 0.021407 seconds and 4 git commands to generate.