these client actions are just toggles; less confusing with better names

This commit is contained in:
okan 2014-09-17 18:41:44 +00:00
parent 458dd31b93
commit 8fd0f43ec2
5 changed files with 53 additions and 51 deletions

View File

@ -371,17 +371,12 @@ void client_cycle_leave(struct screen_ctx *);
void client_delete(struct client_ctx *);
void client_draw_border(struct client_ctx *);
struct client_ctx *client_find(Window);
void client_freeze(struct client_ctx *);
void client_fullscreen(struct client_ctx *);
long client_get_wm_state(struct client_ctx *);
void client_getsizehints(struct client_ctx *);
void client_hidden(struct client_ctx *);
void client_hide(struct client_ctx *);
void client_hmaximize(struct client_ctx *);
void client_htile(struct client_ctx *);
void client_lower(struct client_ctx *);
void client_map(struct client_ctx *);
void client_maximize(struct client_ctx *);
void client_msg(struct client_ctx *, Atom, Time);
void client_move(struct client_ctx *);
struct client_ctx *client_init(Window, struct screen_ctx *);
@ -394,11 +389,16 @@ void client_set_wm_state(struct client_ctx *, long);
void client_setactive(struct client_ctx *);
void client_setname(struct client_ctx *);
int client_snapcalc(int, int, int, int, int);
void client_sticky(struct client_ctx *);
void client_toggle_freeze(struct client_ctx *);
void client_toggle_fullscreen(struct client_ctx *);
void client_toggle_hidden(struct client_ctx *);
void client_toggle_hmaximize(struct client_ctx *);
void client_toggle_maximize(struct client_ctx *);
void client_toggle_sticky(struct client_ctx *);
void client_toggle_vmaximize(struct client_ctx *);
void client_transient(struct client_ctx *);
void client_unhide(struct client_ctx *);
void client_urgency(struct client_ctx *);
void client_vmaximize(struct client_ctx *);
void client_vtile(struct client_ctx *);
void client_warp(struct client_ctx *);
void client_wm_hints(struct client_ctx *);
@ -441,21 +441,14 @@ void kbfunc_client_cycle(struct client_ctx *, union arg *);
void kbfunc_client_cyclegroup(struct client_ctx *,
union arg *);
void kbfunc_client_delete(struct client_ctx *, union arg *);
void kbfunc_client_freeze(struct client_ctx *, union arg *);
void kbfunc_client_fullscreen(struct client_ctx *,
union arg *);
void kbfunc_client_group(struct client_ctx *, union arg *);
void kbfunc_client_grouponly(struct client_ctx *,
union arg *);
void kbfunc_client_grouptoggle(struct client_ctx *,
union arg *);
void kbfunc_client_hide(struct client_ctx *, union arg *);
void kbfunc_client_hmaximize(struct client_ctx *,
union arg *);
void kbfunc_client_label(struct client_ctx *, union arg *);
void kbfunc_client_lower(struct client_ctx *, union arg *);
void kbfunc_client_maximize(struct client_ctx *,
union arg *);
void kbfunc_client_moveresize(struct client_ctx *,
union arg *);
void kbfunc_client_movetogroup(struct client_ctx *,
@ -465,8 +458,17 @@ void kbfunc_client_nogroup(struct client_ctx *,
void kbfunc_client_raise(struct client_ctx *, union arg *);
void kbfunc_client_rcycle(struct client_ctx *, union arg *);
void kbfunc_client_search(struct client_ctx *, union arg *);
void kbfunc_client_sticky(struct client_ctx *, union arg *);
void kbfunc_client_vmaximize(struct client_ctx *,
void kbfunc_client_toggle_freeze(struct client_ctx *,
union arg *);
void kbfunc_client_toggle_fullscreen(struct client_ctx *,
union arg *);
void kbfunc_client_toggle_hmaximize(struct client_ctx *,
union arg *);
void kbfunc_client_toggle_maximize(struct client_ctx *,
union arg *);
void kbfunc_client_toggle_sticky(struct client_ctx *,
union arg *);
void kbfunc_client_toggle_vmaximize(struct client_ctx *,
union arg *);
void kbfunc_cmdexec(struct client_ctx *, union arg *);
void kbfunc_cwm_status(struct client_ctx *, union arg *);

View File

@ -231,7 +231,7 @@ client_current(void)
}
void
client_freeze(struct client_ctx *cc)
client_toggle_freeze(struct client_ctx *cc)
{
if (cc->flags & CLIENT_FREEZE)
cc->flags &= ~CLIENT_FREEZE;
@ -240,7 +240,7 @@ client_freeze(struct client_ctx *cc)
}
void
client_hidden(struct client_ctx *cc)
client_toggle_hidden(struct client_ctx *cc)
{
if (cc->flags & CLIENT_HIDDEN)
cc->flags &= ~CLIENT_HIDDEN;
@ -251,7 +251,7 @@ client_hidden(struct client_ctx *cc)
}
void
client_sticky(struct client_ctx *cc)
client_toggle_sticky(struct client_ctx *cc)
{
if (cc->flags & CLIENT_STICKY)
cc->flags &= ~CLIENT_STICKY;
@ -262,7 +262,7 @@ client_sticky(struct client_ctx *cc)
}
void
client_fullscreen(struct client_ctx *cc)
client_toggle_fullscreen(struct client_ctx *cc)
{
struct screen_ctx *sc = cc->sc;
struct geom xine;
@ -294,7 +294,7 @@ resize:
}
void
client_maximize(struct client_ctx *cc)
client_toggle_maximize(struct client_ctx *cc)
{
struct screen_ctx *sc = cc->sc;
struct geom xine;
@ -339,7 +339,7 @@ resize:
}
void
client_vmaximize(struct client_ctx *cc)
client_toggle_vmaximize(struct client_ctx *cc)
{
struct screen_ctx *sc = cc->sc;
struct geom xine;
@ -371,7 +371,7 @@ resize:
}
void
client_hmaximize(struct client_ctx *cc)
client_toggle_hmaximize(struct client_ctx *cc)
{
struct screen_ctx *sc = cc->sc;
struct geom xine;

12
conf.c
View File

@ -382,12 +382,12 @@ static const struct {
{ "rcycleingroup", kbfunc_client_cycle, CWM_WIN,
{.i = CWM_RCYCLE|CWM_INGROUP} },
{ "grouptoggle", kbfunc_client_grouptoggle, CWM_WIN, {0}},
{ "sticky", kbfunc_client_sticky, CWM_WIN, {0} },
{ "fullscreen", kbfunc_client_fullscreen, CWM_WIN, {0} },
{ "maximize", kbfunc_client_maximize, CWM_WIN, {0} },
{ "vmaximize", kbfunc_client_vmaximize, CWM_WIN, {0} },
{ "hmaximize", kbfunc_client_hmaximize, CWM_WIN, {0} },
{ "freeze", kbfunc_client_freeze, CWM_WIN, {0} },
{ "sticky", kbfunc_client_toggle_sticky, CWM_WIN, {0} },
{ "fullscreen", kbfunc_client_toggle_fullscreen, CWM_WIN, {0} },
{ "maximize", kbfunc_client_toggle_maximize, CWM_WIN, {0} },
{ "vmaximize", kbfunc_client_toggle_vmaximize, CWM_WIN, {0} },
{ "hmaximize", kbfunc_client_toggle_hmaximize, CWM_WIN, {0} },
{ "freeze", kbfunc_client_toggle_freeze, CWM_WIN, {0} },
{ "restart", kbfunc_cwm_status, 0, {.i = CWM_RESTART} },
{ "quit", kbfunc_cwm_status, 0, {.i = CWM_QUIT} },
{ "exec", kbfunc_exec, 0, {.i = CWM_EXEC_PROGRAM} },

View File

@ -448,39 +448,39 @@ kbfunc_client_movetogroup(struct client_ctx *cc, union arg *arg)
}
void
kbfunc_client_sticky(struct client_ctx *cc, union arg *arg)
kbfunc_client_toggle_sticky(struct client_ctx *cc, union arg *arg)
{
client_sticky(cc);
client_toggle_sticky(cc);
}
void
kbfunc_client_fullscreen(struct client_ctx *cc, union arg *arg)
kbfunc_client_toggle_fullscreen(struct client_ctx *cc, union arg *arg)
{
client_fullscreen(cc);
client_toggle_fullscreen(cc);
}
void
kbfunc_client_maximize(struct client_ctx *cc, union arg *arg)
kbfunc_client_toggle_maximize(struct client_ctx *cc, union arg *arg)
{
client_maximize(cc);
client_toggle_maximize(cc);
}
void
kbfunc_client_vmaximize(struct client_ctx *cc, union arg *arg)
kbfunc_client_toggle_vmaximize(struct client_ctx *cc, union arg *arg)
{
client_vmaximize(cc);
client_toggle_vmaximize(cc);
}
void
kbfunc_client_hmaximize(struct client_ctx *cc, union arg *arg)
kbfunc_client_toggle_hmaximize(struct client_ctx *cc, union arg *arg)
{
client_hmaximize(cc);
client_toggle_hmaximize(cc);
}
void
kbfunc_client_freeze(struct client_ctx *cc, union arg *arg)
kbfunc_client_toggle_freeze(struct client_ctx *cc, union arg *arg)
{
client_freeze(cc);
client_toggle_freeze(cc);
}
void

20
xutil.c
View File

@ -372,19 +372,19 @@ xu_ewmh_handle_net_wm_state_msg(struct client_ctx *cc, int action,
} handlers[] = {
{ _NET_WM_STATE_STICKY,
CLIENT_STICKY,
client_sticky },
client_toggle_sticky },
{ _NET_WM_STATE_MAXIMIZED_VERT,
CLIENT_VMAXIMIZED,
client_vmaximize },
client_toggle_vmaximize },
{ _NET_WM_STATE_MAXIMIZED_HORZ,
CLIENT_HMAXIMIZED,
client_hmaximize },
client_toggle_hmaximize },
{ _NET_WM_STATE_HIDDEN,
CLIENT_HIDDEN,
client_hidden },
client_toggle_hidden },
{ _NET_WM_STATE_FULLSCREEN,
CLIENT_FULLSCREEN,
client_fullscreen },
client_toggle_fullscreen },
{ _NET_WM_STATE_DEMANDS_ATTENTION,
CLIENT_URGENCY,
client_urgency },
@ -418,15 +418,15 @@ xu_ewmh_restore_net_wm_state(struct client_ctx *cc)
atoms = xu_ewmh_get_net_wm_state(cc, &n);
for (i = 0; i < n; i++) {
if (atoms[i] == ewmh[_NET_WM_STATE_STICKY])
client_sticky(cc);
client_toggle_sticky(cc);
if (atoms[i] == ewmh[_NET_WM_STATE_MAXIMIZED_HORZ])
client_hmaximize(cc);
client_toggle_hmaximize(cc);
if (atoms[i] == ewmh[_NET_WM_STATE_MAXIMIZED_VERT])
client_vmaximize(cc);
client_toggle_vmaximize(cc);
if (atoms[i] == ewmh[_NET_WM_STATE_HIDDEN])
client_hidden(cc);
client_toggle_hidden(cc);
if (atoms[i] == ewmh[_NET_WM_STATE_FULLSCREEN])
client_fullscreen(cc);
client_toggle_fullscreen(cc);
if (atoms[i] == ewmh[_NET_WM_STATE_DEMANDS_ATTENTION])
client_urgency(cc);
}