diff options
author | okan <okan> | 2016-11-15 00:07:03 +0000 |
---|---|---|
committer | okan <okan> | 2016-11-15 00:07:03 +0000 |
commit | 62dc5ae1320c833d1d6a8354543cada41a2bc4f3 (patch) | |
tree | 212f413c6baafff5e10b89fa8a8f7ddd7002c138 /kbfunc.c | |
parent | ed22d7a944879a2b296a53e40fbce2b86339ce9f (diff) | |
download | cwm-62dc5ae1320c833d1d6a8354543cada41a2bc4f3.tar.gz cwm-62dc5ae1320c833d1d6a8354543cada41a2bc4f3.tar.xz cwm-62dc5ae1320c833d1d6a8354543cada41a2bc4f3.zip |
Add a wrapper based upon xevent handlers around client move/resize for key and
mouse bindings.
Diffstat (limited to 'kbfunc.c')
-rw-r--r-- | kbfunc.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/kbfunc.c b/kbfunc.c index 8edea79..40bd84e 100644 --- a/kbfunc.c +++ b/kbfunc.c @@ -86,6 +86,17 @@ kbfunc_ptrmove(void *ctx, union arg *arg, enum xev xev) void kbfunc_client_move(void *ctx, union arg *arg, enum xev xev) { + int m = (xev == CWM_XEV_BTN); + + if (m) + mousefunc_client_move(ctx, arg, xev); + else + kbfunc_client_move_key(ctx, arg, xev); +} + +void +kbfunc_client_move_key(void *ctx, union arg *arg, enum xev xev) +{ struct client_ctx *cc = ctx; struct screen_ctx *sc = cc->sc; struct geom area; @@ -140,6 +151,17 @@ kbfunc_client_move(void *ctx, union arg *arg, enum xev xev) void kbfunc_client_resize(void *ctx, union arg *arg, enum xev xev) { + int m = (xev == CWM_XEV_BTN); + + if (m) + mousefunc_client_resize(ctx, arg, xev); + else + kbfunc_client_resize_key(ctx, arg, xev); +} + +void +kbfunc_client_resize_key(void *ctx, union arg *arg, enum xev xev) +{ struct client_ctx *cc = ctx; unsigned int mx = 0, my = 0; int amt = 1; |