all repos — openbox @ 87ed1124fbed16bd93e2fa4ffded9c9576319841

openbox fork - make it a bit more like ryudo

key chains get built properly!
Dana Jansens danakj@orodu.net
commit

87ed1124fbed16bd93e2fa4ffded9c9576319841

parent

3661e55fba3b5f3be246b3f65d650460282018ac

1 files changed, 8 insertions(+), 11 deletions(-)

jump to
M src/bindings.ccsrc/bindings.cc

@@ -26,9 +26,7 @@ if (p->first_child)

print_branch(p->first_child, str + " " + p->text); if (!p->chain) printf("%d%s\n", p->id, (str + " " + p->text).c_str()); - BindingTree *s = p->next_sibling; - delete p; - p = s; + p = p->next_sibling; } }

@@ -44,7 +42,6 @@

bool OBBindings::translate(const std::string &str, Binding &b) { unsigned int mods = 0; - std::string modstring; // parse out the base key name std::string::size_type keybegin = str.find_last_of('-');

@@ -58,7 +55,6 @@ while (begin != keybegin) {

end = str.find_first_of('-', begin); std::string mod(str, begin, end-begin); - modstring += mod; if (mod == "C") { // control mods |= ControlMask;

@@ -89,8 +85,6 @@ }

begin = end + 1; } - printf("got modifier: %s\n", modstring.c_str()); - KeySym sym = XStringToKeysym(const_cast<char *>(key.c_str())); if (sym == NoSymbol) return false; b.modifiers = mods;

@@ -130,8 +124,8 @@ // set the proper chain status on the last node

p->chain = false; } - printf("BUILDING:\n"); - print_branch(ret, ""); +// printf("BUILDING:\n"); +// print_branch(ret, ""); // successfully built a tree return ret;

@@ -169,7 +163,7 @@ } else {

a = _tree.first_child; last = a; b = node; - while (a->first_child) { + while (a) { last = a; if (a->binding != b->binding) { a = a->next_sibling;

@@ -180,7 +174,10 @@ delete tmp;

a = a->first_child; } } - last->first_child = b->first_child; + if (last->binding != b->binding) + last->next_sibling = b; + else + last->first_child = b->first_child; delete b; } }