diff options
author | Markus Teich | 2017-01-07 17:21:30 +0100 |
---|---|---|
committer | Anselm R Garbe | 2017-03-28 20:23:38 +0200 |
commit | 87e639cbb1baa9174a42a5db472fedcf282f63fc (patch) | |
tree | 0ffc2a7385900f95dbd8542b474947adeb616d7d | |
parent | 96e70e0f9b25cb0b7af1cbb1249efd58ed8fe28a (diff) | |
download | aur-87e639cbb1baa9174a42a5db472fedcf282f63fc.tar.gz |
Don't restrict snap in mousemove
This also fixes a bug where client windows only switch to floating mode when the
mouse is dragged in one specific direction.
-rw-r--r-- | dwm.c | 25 |
1 files changed, 11 insertions, 14 deletions
@@ -1170,20 +1170,17 @@ movemouse(const Arg *arg) nx = ocx + (ev.xmotion.x - x); ny = ocy + (ev.xmotion.y - y); - if (nx >= selmon->wx && nx <= selmon->wx + selmon->ww - && ny >= selmon->wy && ny <= selmon->wy + selmon->wh) { - if (abs(selmon->wx - nx) < snap) - nx = selmon->wx; - else if (abs((selmon->wx + selmon->ww) - (nx + WIDTH(c))) < snap) - nx = selmon->wx + selmon->ww - WIDTH(c); - if (abs(selmon->wy - ny) < snap) - ny = selmon->wy; - else if (abs((selmon->wy + selmon->wh) - (ny + HEIGHT(c))) < snap) - ny = selmon->wy + selmon->wh - HEIGHT(c); - if (!c->isfloating && selmon->lt[selmon->sellt]->arrange - && (abs(nx - c->x) > snap || abs(ny - c->y) > snap)) - togglefloating(NULL); - } + if (abs(selmon->wx - nx) < snap) + nx = selmon->wx; + else if (abs((selmon->wx + selmon->ww) - (nx + WIDTH(c))) < snap) + nx = selmon->wx + selmon->ww - WIDTH(c); + if (abs(selmon->wy - ny) < snap) + ny = selmon->wy; + else if (abs((selmon->wy + selmon->wh) - (ny + HEIGHT(c))) < snap) + ny = selmon->wy + selmon->wh - HEIGHT(c); + if (!c->isfloating && selmon->lt[selmon->sellt]->arrange + && (abs(nx - c->x) > snap || abs(ny - c->y) > snap)) + togglefloating(NULL); if (!selmon->lt[selmon->sellt]->arrange || c->isfloating) resize(c, nx, ny, c->w, c->h, 1); break; |