diff options
author | Okan Demirmen <okan@cvs.openbsd.org> | 2015-11-17 14:31:29 +0000 |
---|---|---|
committer | Okan Demirmen <okan@cvs.openbsd.org> | 2015-11-17 14:31:29 +0000 |
commit | d3049c7964807d37df091ac4079224d5112325ac (patch) | |
tree | 61e6c86776b47f43dbc6de03d488eed6f8e38eb7 | |
parent | f06973897f295a0003206ce2f9b2bc8785c1e317 (diff) |
Inline the only use of mousefunc_sweep_calc.
-rw-r--r-- | app/cwm/mousefunc.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/app/cwm/mousefunc.c b/app/cwm/mousefunc.c index 4cb2e3028..c93fd6608 100644 --- a/app/cwm/mousefunc.c +++ b/app/cwm/mousefunc.c @@ -16,7 +16,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: mousefunc.c,v 1.102 2015/11/11 14:22:01 okan Exp $ + * $OpenBSD: mousefunc.c,v 1.103 2015/11/17 14:31:28 okan Exp $ */ #include <sys/types.h> @@ -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: |