all repos — openbox @ 481e68112177d1a1c0eb920f37c372ea34eeb371

openbox fork - make it a bit more like ryudo

fix using uninit'd memory. don't use 0 keycode
Dana Jansens danakj@orodu.net
commit

481e68112177d1a1c0eb920f37c372ea34eeb371

parent

7f262bc2a0733a77ae5a30752aecdcf4ba35f223

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

jump to
M openbox/modkeys.copenbox/modkeys.c

@@ -64,12 +64,17 @@ for (j = 0; j < modmap->max_keypermod; ++j) {

KeySym sym; /* get a keycode that is bound to the mask (i) */ KeyCode keycode = modmap->modifiermap[i*modmap->max_keypermod + j]; - /* go through each keysym bound to the given keycode */ - for (k = 0; k < keysyms_per_keycode; ++k) { - sym = keymap[(keycode-min_keycode) * keysyms_per_keycode + k]; - if (sym != NoSymbol) { - /* bind the key to the mask (e.g. Alt_L => Mod1Mask) */ - set_modkey_mask(nth_mask(i), sym); + g_print("keycode %d for mask %d\n", keycode, i); + if (keycode) { + /* go through each keysym bound to the given keycode */ + for (k = 0; k < keysyms_per_keycode; ++k) { + sym = keymap[(keycode-min_keycode) * keysyms_per_keycode + + k]; + g_print("k %d sym %s \n", k, XKeysymToString(sym)); + if (sym != NoSymbol) { + /* bind the key to the mask (e.g. Alt_L => Mod1Mask) */ + set_modkey_mask(nth_mask(i), sym); + } } } }