diff options
author | okan | 2016-10-06 14:41:19 +0000 |
---|---|---|
committer | okan | 2016-10-06 14:41:19 +0000 |
commit | 9d358af1dd11a75cf4778e096df8f52cb1ca690b (patch) | |
tree | 9e40148cf90de010622f87a77f515231ffaf5a21 /conf.c | |
parent | 97f575bc42f2f8f9458adf55d1fc29e8bd021c83 (diff) | |
download | cwm-9d358af1dd11a75cf4778e096df8f52cb1ca690b.tar.gz |
Add an argument to the callbacks to pass the xevent context, button or
key press. This allows to remove a few hacks to duplicate functions only
for behaviour changes; now differing behaviours are pushed down to the
callback. Also will allow for previously unavailable actions to be bind-able
down the road.
Diffstat (limited to 'conf.c')
-rw-r--r-- | conf.c | 19 |
1 files changed, 7 insertions, 12 deletions
@@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: conf.c,v 1.214 2016/10/05 13:35:17 okan Exp $ + * $OpenBSD: conf.c,v 1.215 2016/10/06 14:41:19 okan Exp $ */ #include <sys/types.h> @@ -351,7 +351,7 @@ conf_client(struct client_ctx *cc) static const struct { const char *tag; - void (*handler)(struct client_ctx *, union arg *); + void (*handler)(struct client_ctx *, union arg *, int); int context; union arg argument; } name_to_func[] = { @@ -412,8 +412,7 @@ static const struct { {.i = (CWM_CLIENT_CYCLE | CWM_CLIENT_CYCLE_INGRP)} }, { "rcycleingroup", kbfunc_client_cycle, CWM_CONTEXT_CLIENT, {.i = (CWM_CLIENT_RCYCLE | CWM_CLIENT_CYCLE_INGRP)} }, - { "grouptoggle", kbfunc_client_grouptoggle, CWM_CONTEXT_CLIENT, - {.i = CWM_KBD}}, + { "grouptoggle", kbfunc_client_grouptoggle, CWM_CONTEXT_CLIENT, {0}}, { "stick", kbfunc_client_toggle_sticky, CWM_CONTEXT_CLIENT, {0} }, { "fullscreen", kbfunc_client_toggle_fullscreen, CWM_CONTEXT_CLIENT, {0} }, @@ -489,14 +488,10 @@ static const struct { { "window_hide", kbfunc_client_hide, CWM_CONTEXT_CLIENT, {0} }, { "window_move", mousefunc_client_move, CWM_CONTEXT_CLIENT, {0} }, { "window_resize", mousefunc_client_resize, CWM_CONTEXT_CLIENT, {0} }, - { "window_grouptoggle", kbfunc_client_grouptoggle, CWM_CONTEXT_CLIENT, - {.i = CWM_MOUSE} }, - { "menu_group", kbfunc_menu_group, CWM_CONTEXT_SCREEN, - {.i = CWM_MOUSE} }, - { "menu_unhide", kbfunc_menu_client, CWM_CONTEXT_SCREEN, - {.i = CWM_MOUSE} }, - { "menu_cmd", kbfunc_menu_cmd, CWM_CONTEXT_SCREEN, - {.i = CWM_MOUSE} }, + { "window_grouptoggle", kbfunc_client_grouptoggle, CWM_CONTEXT_CLIENT, {0} }, + { "menu_group", kbfunc_menu_group, CWM_CONTEXT_SCREEN, {0} }, + { "menu_unhide", kbfunc_menu_client, CWM_CONTEXT_SCREEN, {0} }, + { "menu_cmd", kbfunc_menu_cmd, CWM_CONTEXT_SCREEN, {0} }, }; static const struct { |