Add a wrapper based upon xevent handlers around client move/resize for key and

mouse bindings.
This commit is contained in:
okan
2016-11-15 00:07:03 +00:00
parent ed22d7a944
commit 62dc5ae132
3 changed files with 26 additions and 2 deletions

View File

@@ -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;