summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Teich <markus.teich@stusta.mhn.de>2017-01-07 17:21:30 +0100
committerAnselm R Garbe <anselm@garbe.us>2017-03-28 20:23:38 +0200
commit5b238c8dab945023b6a16a6c9f642b11137f2204 (patch)
treeaefefcf78684fe69fe7518e6d954ae2860ef4de3
parentButton passthrough when client is not focused (diff)
downloaddwm-5b238c8dab945023b6a16a6c9f642b11137f2204.tar.gz
dwm-5b238c8dab945023b6a16a6c9f642b11137f2204.zip
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.
Diffstat (limited to '')
-rw-r--r--dwm.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/dwm.c b/dwm.c
index 9c01d1a..7861512 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1170,20 +1170,17 @@ movemouse(const Arg *arg)
1170 1170
1171 nx = ocx + (ev.xmotion.x - x); 1171 nx = ocx + (ev.xmotion.x - x);
1172 ny = ocy + (ev.xmotion.y - y); 1172 ny = ocy + (ev.xmotion.y - y);
1173 if (nx >= selmon->wx && nx <= selmon->wx + selmon->ww 1173 if (abs(selmon->wx - nx) < snap)
1174 && ny >= selmon->wy && ny <= selmon->wy + selmon->wh) { 1174 nx = selmon->wx;
1175 if (abs(selmon->wx - nx) < snap) 1175 else if (abs((selmon->wx + selmon->ww) - (nx + WIDTH(c))) < snap)
1176 nx = selmon->wx; 1176 nx = selmon->wx + selmon->ww - WIDTH(c);
1177 else if (abs((selmon->wx + selmon->ww) - (nx + WIDTH(c))) < snap) 1177 if (abs(selmon->wy - ny) < snap)
1178 nx = selmon->wx + selmon->ww - WIDTH(c); 1178 ny = selmon->wy;
1179 if (abs(selmon->wy - ny) < snap) 1179 else if (abs((selmon->wy + selmon->wh) - (ny + HEIGHT(c))) < snap)
1180 ny = selmon->wy; 1180 ny = selmon->wy + selmon->wh - HEIGHT(c);
1181 else if (abs((selmon->wy + selmon->wh) - (ny + HEIGHT(c))) < snap) 1181 if (!c->isfloating && selmon->lt[selmon->sellt]->arrange
1182 ny = selmon->wy + selmon->wh - HEIGHT(c); 1182 && (abs(nx - c->x) > snap || abs(ny - c->y) > snap))
1183 if (!c->isfloating && selmon->lt[selmon->sellt]->arrange 1183 togglefloating(NULL);
1184 && (abs(nx - c->x) > snap || abs(ny - c->y) > snap))
1185 togglefloating(NULL);
1186 }
1187 if (!selmon->lt[selmon->sellt]->arrange || c->isfloating) 1184 if (!selmon->lt[selmon->sellt]->arrange || c->isfloating)
1188 resize(c, nx, ny, c->w, c->h, 1); 1185 resize(c, nx, ny, c->w, c->h, 1);
1189 break; 1186 break;