summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--conf.c2
-rw-r--r--kbfunc.c16
-rw-r--r--mousefunc.c23
3 files changed, 17 insertions, 24 deletions
diff --git a/conf.c b/conf.c
index 13c08d2..37b50dc 100644
--- a/conf.c
+++ b/conf.c
@@ -483,7 +483,7 @@ static const struct {
 	{ "window_hide", kbfunc_client_hide, CWM_CONTEXT_CLIENT, {0} },
 	{ "window_move", mousefunc_client_move, CWM_CONTEXT_CLIENT, {0} },
 	{ "window_resize", mousefunc_client_resize, CWM_CONTEXT_CLIENT, {0} },
-	{ "window_grouptoggle", kbfunc_group_toggle, CWM_CONTEXT_CLIENT,
+	{ "window_grouptoggle", kbfunc_client_grouptoggle, CWM_CONTEXT_CLIENT,
 	   {.i = CWM_MOUSE} },
 	{ "menu_group", mousefunc_menu_group, CWM_CONTEXT_SCREEN, {0} },
 	{ "menu_unhide", mousefunc_menu_client, CWM_CONTEXT_SCREEN, {0} },
diff --git a/kbfunc.c b/kbfunc.c
index da647b3..715c682 100644
--- a/kbfunc.c
+++ b/kbfunc.c
@@ -38,7 +38,7 @@
 
 extern sig_atomic_t	 cwm_status;
 
-static void kbfunc_amount(int, unsigned int *, unsigned int *);
+static void kbfunc_amount(int, int, unsigned int *, unsigned int *);
 
 void
 kbfunc_client_lower(struct client_ctx *cc, union arg *arg)
@@ -54,12 +54,10 @@ kbfunc_client_raise(struct client_ctx *cc, union arg *arg)
 }
 
 static void
-kbfunc_amount(int flags, unsigned int *mx, unsigned int *my)
+kbfunc_amount(int flags, int amt, unsigned int *mx, unsigned int *my)
 {
 #define CWM_FACTOR 10
-	int	amt;
 
-	amt = Conf.mamount;
 	if (flags & CWM_BIGAMOUNT)
 		amt *= CWM_FACTOR;
 
@@ -86,7 +84,7 @@ kbfunc_ptrmove(struct client_ctx *cc, union arg *arg)
 	int			 x, y;
 	unsigned int		 mx = 0, my = 0;
 
-	kbfunc_amount(arg->i, &mx, &my);
+	kbfunc_amount(arg->i, Conf.mamount, &mx, &my);
 
 	xu_ptr_getpos(sc->rootwin, &x, &y);
 	xu_ptr_setpos(sc->rootwin, x + mx, y + my);
@@ -103,7 +101,7 @@ kbfunc_client_move(struct client_ctx *cc, union arg *arg)
 	if (cc->flags & CLIENT_FREEZE)
 		return;
 
-	kbfunc_amount(arg->i, &mx, &my);
+	kbfunc_amount(arg->i, Conf.mamount, &mx, &my);
 
 	cc->geom.x += mx;
 	if (cc->geom.x + cc->geom.w < 0)
@@ -137,11 +135,15 @@ void
 kbfunc_client_resize(struct client_ctx *cc, union arg *arg)
 {
 	unsigned int		 mx = 0, my = 0;
+	int			 amt = 1;
 
 	if (cc->flags & CLIENT_FREEZE)
 		return;
 
-	kbfunc_amount(arg->i, &mx, &my);
+	if (!(cc->hint.flags & PResizeInc))
+		amt = Conf.mamount;
+
+	kbfunc_amount(arg->i, amt, &mx, &my);
 
 	if ((cc->geom.w += mx * cc->hint.incw) < cc->hint.minw)
 		cc->geom.w = cc->hint.minw;
diff --git a/mousefunc.c b/mousefunc.c
index d0011cd..5be91bd 100644
--- a/mousefunc.c
+++ b/mousefunc.c
@@ -32,22 +32,9 @@
 
 #include "calmwm.h"
 
-static void	mousefunc_sweep_calc(struct client_ctx *, int, int, int, int);
 static void	mousefunc_sweep_draw(struct client_ctx *);
 
 static void
-mousefunc_sweep_calc(struct client_ctx *cc, int x, int y, int mx, int my)
-{
-	cc->geom.w = abs(x - mx) - cc->bwidth;
-	cc->geom.h = abs(y - my) - cc->bwidth;
-
-	client_applysizehints(cc);
-
-	cc->geom.x = (x <= mx) ? x : x - cc->geom.w;
-	cc->geom.y = (y <= my) ? y : y - cc->geom.h;
-}
-
-static void
 mousefunc_sweep_draw(struct client_ctx *cc)
 {
 	struct screen_ctx	*sc = cc->sc;
@@ -94,8 +81,13 @@ mousefunc_client_resize(struct client_ctx *cc, union arg *arg)
 				continue;
 			ltime = ev.xmotion.time;
 
-			mousefunc_sweep_calc(cc, x, y,
-			    ev.xmotion.x_root, ev.xmotion.y_root);
+			cc->geom.w = abs(x - ev.xmotion.x_root) - cc->bwidth;
+			cc->geom.h = abs(y - ev.xmotion.y_root) - cc->bwidth;
+			cc->geom.x = (x <= ev.xmotion.x_root) ?
+				x : x - cc->geom.w;
+			cc->geom.y = (y <= ev.xmotion.y_root) ?
+				y : y - cc->geom.h;
+			client_applysizehints(cc);
 			client_resize(cc, 1);
 			mousefunc_sweep_draw(cc);
 			break;
@@ -158,7 +150,6 @@ mousefunc_client_move(struct client_ctx *cc, union arg *arg)
 			cc->geom.y += client_snapcalc(cc->geom.y,
 			    cc->geom.y + cc->geom.h + (cc->bwidth * 2),
 			    area.y, area.y + area.h, sc->snapdist);
-
 			client_move(cc);
 			break;
 		case ButtonRelease: