diff options
author | okan | 2015-11-17 14:32:38 +0000 |
---|---|---|
committer | okan | 2015-11-17 14:32:38 +0000 |
commit | 8d26abfafe4eaa90fcc9a19f0a2a00860df21037 (patch) | |
tree | b9ecaa2738108ec7c9191a9bdcc05ee4a0556e07 /kbfunc.c | |
parent | c120253c0fb894116ae782fffd89468c6ebbc0c8 (diff) | |
download | cwm-8d26abfafe4eaa90fcc9a19f0a2a00860df21037.tar.gz |
If a client does not set increment values, use 'moveamount' as a way to
scale keyboard based resizes; extend kbfunc_amount().
Behaviour noted by, tested by, and ok sthen@
Diffstat (limited to '')
-rw-r--r-- | kbfunc.c | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -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.125 2015/11/12 21:28:03 okan Exp $ + * $OpenBSD: kbfunc.c,v 1.126 2015/11/17 14:32:38 okan Exp $ */ #include <sys/types.h> @@ -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; |