summary refs log tree commit diff
path: root/mousefunc.c
diff options
context:
space:
mode:
authorokan <okan>2015-11-17 15:19:19 +0000
committerokan <okan>2015-11-17 15:19:19 +0000
commitf9e9f76856c849ca9686d0ed6413958fd151b758 (patch)
treef268782bfdb21c03835cc1aca06bd2e2fd46773b /mousefunc.c
parent669631e5fa8c0becf0bca7421eb364467077a86f (diff)
parent4ac6daa27ded7927d481810a2350942feef20978 (diff)
downloadcwm-f9e9f76856c849ca9686d0ed6413958fd151b758.tar.gz
cwm-f9e9f76856c849ca9686d0ed6413958fd151b758.tar.xz
cwm-f9e9f76856c849ca9686d0ed6413958fd151b758.zip
cvsimport
* refs/heads/master:
  Fix a typo from r1.201; fixes window_grouptoggle binding.
  If a client does not set increment values, use 'moveamount' as a way to scale keyboard based resizes; extend kbfunc_amount().
  Inline the only use of mousefunc_sweep_calc.
Diffstat (limited to 'mousefunc.c')
-rw-r--r--mousefunc.c23
1 files changed, 7 insertions, 16 deletions
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: