summary refs log tree commit diff
diff options
context:
space:
mode:
authorokan <okan>2014-09-17 18:41:44 +0000
committerokan <okan>2014-09-17 18:41:44 +0000
commit8fd0f43ec2027080cc3b6199897b905b134b79c5 (patch)
treeb7a4d1aca7092535e56802ffbea23a642a0ebcb5
parent458dd31b937e1ee84699ec346fd1304a14bb0cf6 (diff)
downloadcwm-8fd0f43ec2027080cc3b6199897b905b134b79c5.tar.gz
cwm-8fd0f43ec2027080cc3b6199897b905b134b79c5.tar.xz
cwm-8fd0f43ec2027080cc3b6199897b905b134b79c5.zip
these client actions are just toggles; less confusing with better names
-rw-r--r--calmwm.h34
-rw-r--r--client.c14
-rw-r--r--conf.c12
-rw-r--r--kbfunc.c24
-rw-r--r--xutil.c20
5 files changed, 53 insertions, 51 deletions
diff --git a/calmwm.h b/calmwm.h
index 616839b..dd8a782 100644
--- a/calmwm.h
+++ b/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 19ebece..d6700a1 100644
--- a/client.c
+++ b/client.c
@@ -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 1660173..181bf09 100644
--- a/conf.c
+++ b/conf.c
@@ -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 a379e4e..f144ee0 100644
--- a/kbfunc.c
+++ b/kbfunc.c
@@ -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 ba8e085..91ef51b 100644
--- a/xutil.c
+++ b/xutil.c
@@ -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);
 	}