diff options
author | okan <okan> | 2015-03-29 00:21:05 +0000 |
---|---|---|
committer | okan <okan> | 2015-03-29 00:21:05 +0000 |
commit | bc21e4aa37b36b486f7f6ddcb6050e2be93590c1 (patch) | |
tree | da1b2c2fff822dbb33ab2c7b2692cb7599796d03 /conf.c | |
parent | 668da8493abd2abb6242a0a707e4d745c01b1031 (diff) | |
parent | 557cd382dcd973fd96605c3359e3d6dfa45a4fd9 (diff) | |
download | cwm-bc21e4aa37b36b486f7f6ddcb6050e2be93590c1.tar.gz cwm-bc21e4aa37b36b486f7f6ddcb6050e2be93590c1.tar.xz cwm-bc21e4aa37b36b486f7f6ddcb6050e2be93590c1.zip |
cvsimport
Diffstat (limited to 'conf.c')
-rw-r--r-- | conf.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/conf.c b/conf.c index 5f8f39c..da51d4e 100644 --- a/conf.c +++ b/conf.c @@ -491,11 +491,10 @@ conf_bind_kbd(struct conf *c, const char *bind, const char *cmd) { struct binding *kb; const char *key; - unsigned int i, mask; + unsigned int i; - kb = xcalloc(1, sizeof(*kb)); - key = conf_bind_getmask(bind, &mask); - kb->modmask |= mask; + kb = xmalloc(sizeof(*kb)); + key = conf_bind_getmask(bind, &kb->modmask); kb->press.keysym = XStringToKeysym(key); if (kb->press.keysym == NoSymbol) { @@ -519,15 +518,13 @@ conf_bind_kbd(struct conf *c, const char *bind, const char *cmd) kb->callback = name_to_func[i].handler; kb->flags = name_to_func[i].flags; kb->argument = name_to_func[i].argument; - kb->argtype |= ARG_INT; TAILQ_INSERT_TAIL(&c->keybindingq, kb, entry); return(1); } kb->callback = kbfunc_cmdexec; - kb->flags = 0; + kb->flags = CWM_CMD; kb->argument.c = xstrdup(cmd); - kb->argtype |= ARG_CHAR; TAILQ_INSERT_TAIL(&c->keybindingq, kb, entry); return(1); } @@ -543,7 +540,7 @@ conf_unbind_kbd(struct conf *c, struct binding *unbind) if (key->press.keysym == unbind->press.keysym) { TAILQ_REMOVE(&c->keybindingq, key, entry); - if (key->argtype & ARG_CHAR) + if (key->flags & CWM_CMD) free(key->argument.c); free(key); } @@ -555,11 +552,10 @@ conf_bind_mouse(struct conf *c, const char *bind, const char *cmd) { struct binding *mb; const char *button, *errstr; - unsigned int i, mask; + unsigned int i; - mb = xcalloc(1, sizeof(*mb)); - button = conf_bind_getmask(bind, &mask); - mb->modmask |= mask; + mb = xmalloc(sizeof(*mb)); + button = conf_bind_getmask(bind, &mb->modmask); mb->press.button = strtonum(button, Button1, Button5, &errstr); if (errstr) { |