From 83a14a0e1508598ad1d3c333ee7ae6e06f0454e5 Mon Sep 17 00:00:00 2001 From: okan Date: Wed, 17 Sep 2014 18:41:44 +0000 Subject: these client actions are just toggles; less confusing with better names --- calmwm.h | 36 +++++++++++++++++++----------------- client.c | 16 ++++++++-------- conf.c | 14 +++++++------- kbfunc.c | 26 +++++++++++++------------- xutil.c | 22 +++++++++++----------- 5 files changed, 58 insertions(+), 56 deletions(-) diff --git a/calmwm.h b/calmwm.h index f73e762..b030c52 100644 --- a/calmwm.h +++ b/calmwm.h @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: calmwm.h,v 1.278 2014/09/17 16:32:53 okan Exp $ + * $OpenBSD: calmwm.h,v 1.279 2014/09/17 18:41:44 okan Exp $ */ #ifndef _CALMWM_H_ @@ -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 *); diff --git a/client.c b/client.c index 5a3baba..91538b1 100644 --- a/client.c +++ b/client.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: client.c,v 1.186 2014/09/17 18:09:30 okan Exp $ + * $OpenBSD: client.c,v 1.187 2014/09/17 18:41:44 okan Exp $ */ #include @@ -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; diff --git a/conf.c b/conf.c index 89eef07..3615701 100644 --- a/conf.c +++ b/conf.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: conf.c,v 1.180 2014/09/17 16:00:44 okan Exp $ + * $OpenBSD: conf.c,v 1.181 2014/09/17 18:41:44 okan Exp $ */ #include @@ -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} }, diff --git a/kbfunc.c b/kbfunc.c index 07de207..d92f545 100644 --- a/kbfunc.c +++ b/kbfunc.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: kbfunc.c,v 1.102 2014/09/17 18:09:30 okan Exp $ + * $OpenBSD: kbfunc.c,v 1.103 2014/09/17 18:41:44 okan Exp $ */ #include @@ -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 diff --git a/xutil.c b/xutil.c index 1ba435e..fe1d535 100644 --- a/xutil.c +++ b/xutil.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: xutil.c,v 1.94 2014/09/17 16:00:44 okan Exp $ + * $OpenBSD: xutil.c,v 1.95 2014/09/17 18:41:44 okan Exp $ */ #include @@ -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); } -- cgit v1.2.3-2-gb3c3