From 62dc5ae1320c833d1d6a8354543cada41a2bc4f3 Mon Sep 17 00:00:00 2001 From: okan Date: Tue, 15 Nov 2016 00:07:03 +0000 Subject: Add a wrapper based upon xevent handlers around client move/resize for key and mouse bindings. --- kbfunc.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'kbfunc.c') diff --git a/kbfunc.c b/kbfunc.c index 8edea79..40bd84e 100644 --- a/kbfunc.c +++ b/kbfunc.c @@ -85,6 +85,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; @@ -139,6 +150,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; -- cgit 1.4.1