mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
Add a wrapper based upon xevent handlers around client move/resize for key and
mouse bindings.
This commit is contained in:
parent
ed22d7a944
commit
62dc5ae132
2
calmwm.h
2
calmwm.h
@ -463,7 +463,9 @@ void screen_assert_clients_within(struct screen_ctx *);
|
|||||||
void kbfunc_cwm_status(void *, union arg *, enum xev);
|
void kbfunc_cwm_status(void *, union arg *, enum xev);
|
||||||
void kbfunc_ptrmove(void *, union arg *, enum xev);
|
void kbfunc_ptrmove(void *, union arg *, enum xev);
|
||||||
void kbfunc_client_move(void *, union arg *, enum xev);
|
void kbfunc_client_move(void *, union arg *, enum xev);
|
||||||
|
void kbfunc_client_move_key(void *, union arg *, enum xev);
|
||||||
void kbfunc_client_resize(void *, union arg *, enum xev);
|
void kbfunc_client_resize(void *, union arg *, enum xev);
|
||||||
|
void kbfunc_client_resize_key(void *, union arg *, enum xev);
|
||||||
void kbfunc_client_delete(void *, union arg *, enum xev);
|
void kbfunc_client_delete(void *, union arg *, enum xev);
|
||||||
void kbfunc_client_lower(void *, union arg *, enum xev);
|
void kbfunc_client_lower(void *, union arg *, enum xev);
|
||||||
void kbfunc_client_raise(void *, union arg *, enum xev);
|
void kbfunc_client_raise(void *, union arg *, enum xev);
|
||||||
|
4
conf.c
4
conf.c
@ -177,8 +177,8 @@ static const struct {
|
|||||||
{ "window_lower", kbfunc_client_lower, CWM_CONTEXT_CC, {0} },
|
{ "window_lower", kbfunc_client_lower, CWM_CONTEXT_CC, {0} },
|
||||||
{ "window_raise", kbfunc_client_raise, CWM_CONTEXT_CC, {0} },
|
{ "window_raise", kbfunc_client_raise, CWM_CONTEXT_CC, {0} },
|
||||||
{ "window_hide", kbfunc_client_hide, CWM_CONTEXT_CC, {0} },
|
{ "window_hide", kbfunc_client_hide, CWM_CONTEXT_CC, {0} },
|
||||||
{ "window_move", mousefunc_client_move, CWM_CONTEXT_CC, {0} },
|
{ "window_move", kbfunc_client_move, CWM_CONTEXT_CC, {0} },
|
||||||
{ "window_resize", mousefunc_client_resize, CWM_CONTEXT_CC, {0} },
|
{ "window_resize", kbfunc_client_resize, CWM_CONTEXT_CC, {0} },
|
||||||
{ "window_grouptoggle", kbfunc_client_toggle_group, CWM_CONTEXT_CC, {0} },
|
{ "window_grouptoggle", kbfunc_client_toggle_group, CWM_CONTEXT_CC, {0} },
|
||||||
{ "menu_group", kbfunc_menu_group, CWM_CONTEXT_SC, {0} },
|
{ "menu_group", kbfunc_menu_group, CWM_CONTEXT_SC, {0} },
|
||||||
{ "menu_unhide", kbfunc_menu_client, CWM_CONTEXT_SC, {0} },
|
{ "menu_unhide", kbfunc_menu_client, CWM_CONTEXT_SC, {0} },
|
||||||
|
22
kbfunc.c
22
kbfunc.c
@ -85,6 +85,17 @@ kbfunc_ptrmove(void *ctx, union arg *arg, enum xev xev)
|
|||||||
|
|
||||||
void
|
void
|
||||||
kbfunc_client_move(void *ctx, union arg *arg, enum xev xev)
|
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 client_ctx *cc = ctx;
|
||||||
struct screen_ctx *sc = cc->sc;
|
struct screen_ctx *sc = cc->sc;
|
||||||
@ -139,6 +150,17 @@ kbfunc_client_move(void *ctx, union arg *arg, enum xev xev)
|
|||||||
|
|
||||||
void
|
void
|
||||||
kbfunc_client_resize(void *ctx, union arg *arg, enum xev xev)
|
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;
|
struct client_ctx *cc = ctx;
|
||||||
unsigned int mx = 0, my = 0;
|
unsigned int mx = 0, my = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user