X-Git-Url: https://jasonwoof.com/gitweb/?p=dwm.git;a=blobdiff_plain;f=dwm.c;h=7b5fa4e318e9eca013b138725cc4ea7f5905dd44;hp=be11381e3290345f1e91d6184ff32668acae09e6;hb=3c48858ffada0825b62e52ac14b1feba4b7654a4;hpb=0bc4e41ebdf4dfbdb4e865ab5297f5df4f0d9e16 diff --git a/dwm.c b/dwm.c index be11381..7b5fa4e 100644 --- a/dwm.c +++ b/dwm.c @@ -1202,7 +1202,7 @@ movemouse(const Arg *arg) { case MotionNotify: nx = ocx + (ev.xmotion.x - x); ny = ocy + (ev.xmotion.y - y); - if(snap && nx >= selmon->wx && nx <= selmon->wx + selmon->ww + 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; @@ -1365,8 +1365,8 @@ resizemouse(const Arg *arg) { case MotionNotify: nw = MAX(ev.xmotion.x - ocx - 2 * c->bw + 1, 1); nh = MAX(ev.xmotion.y - ocy - 2 * c->bw + 1, 1); - if(snap && nw >= selmon->wx && nw <= selmon->wx + selmon->ww - && nh >= selmon->wy && nh <= selmon->wy + selmon->wh) + if(snap && c->mon->wx + nw >= selmon->wx && c->mon->wx + nw <= selmon->wx + selmon->ww + && c->mon->wy + nh >= selmon->wy && c->mon->wy + nh <= selmon->wy + selmon->wh) { if(!c->isfloating && selmon->lt[selmon->sellt]->arrange && (abs(nw - c->w) > snap || abs(nh - c->h) > snap))