diff options
author | Okan Demirmen <okan@cvs.openbsd.org> | 2016-09-13 13:42:29 +0000 |
---|---|---|
committer | Okan Demirmen <okan@cvs.openbsd.org> | 2016-09-13 13:42:29 +0000 |
commit | c2462f0c4cd18e2f48dd67c638fd690fec08e07e (patch) | |
tree | 6b0b7321ff5fa1223ae4f2a7347b154df5b293ec /app/cwm/mousefunc.c | |
parent | dee5914ef686669b7be590cb76df6fc6ac09f8b5 (diff) |
Limit mouse resize to hints within the client; matches kbd resize
behaviour.
Diffstat (limited to 'app/cwm/mousefunc.c')
-rw-r--r-- | app/cwm/mousefunc.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/app/cwm/mousefunc.c b/app/cwm/mousefunc.c index c93fd6608..f72416f9f 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.103 2015/11/17 14:31:28 okan Exp $ + * $OpenBSD: mousefunc.c,v 1.104 2016/09/13 13:42:28 okan Exp $ */ #include <sys/types.h> @@ -57,7 +57,6 @@ mousefunc_client_resize(struct client_ctx *cc, union arg *arg) XEvent ev; Time ltime = 0; struct screen_ctx *sc = cc->sc; - int x = cc->geom.x, y = cc->geom.y; if (cc->flags & CLIENT_FREEZE) return; @@ -81,12 +80,8 @@ mousefunc_client_resize(struct client_ctx *cc, union arg *arg) continue; ltime = ev.xmotion.time; - 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; + cc->geom.w = ev.xmotion.x; + cc->geom.h = ev.xmotion.y; client_applysizehints(cc); client_resize(cc, 1); mousefunc_sweep_draw(cc); |