summaryrefslogtreecommitdiff
path: root/util/epist/keytree.cc
diff options
context:
space:
mode:
authorMarius Nita <marius@cs.pdx.edu>2002-08-22 18:19:57 +0000
committerMarius Nita <marius@cs.pdx.edu>2002-08-22 18:19:57 +0000
commit7cac1f19acf894aaf4470460732574abc158fd78 (patch)
tree8c735f4a346c29073e2e5751a96016e0ad7b4e03 /util/epist/keytree.cc
parent22e8615f6125cc117af9e01124b9bcc2b19c59ab (diff)
toggleGrabs action added
Diffstat (limited to 'util/epist/keytree.cc')
-rw-r--r--util/epist/keytree.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/util/epist/keytree.cc b/util/epist/keytree.cc
index e9fa2cab..6dcba312 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())),