Fix patch resizecorners

This commit is contained in:
BitHeaven 2024-08-24 19:11:56 +05:00
parent 3f74312239
commit 25af6dd966
3 changed files with 8 additions and 3 deletions

BIN
dwm

Binary file not shown.

11
dwm.c
View File

@ -1437,10 +1437,15 @@ resizemouse(const Arg *arg)
continue; continue;
lasttime = ev.xmotion.time; lasttime = ev.xmotion.time;
nx = horizcorner ? ev.xmotion.x : c->x; nx = horizcorner && ocx2 - ev.xmotion.x >= c->minw ? ev.xmotion.x : c->x;
ny = vertcorner ? ev.xmotion.y : c->y; ny = vertcorner && ocy2 - ev.xmotion.y >= c->minh ? ev.xmotion.y : c->y;
nw = MAX(horizcorner ? (ocx2 - nx) : (ev.xmotion.x - ocx - 2 * c->bw + 1), 1); nw = MAX(horizcorner ? (ocx2 - nx) : (ev.xmotion.x - ocx - 2 * c->bw + 1), 1);
nh = MAX(vertcorner ? (ocy2 - ny) : (ev.xmotion.y - ocy - 2 * c->bw + 1), 1); nh = MAX(vertcorner ? (ocy2 - ny) : (ev.xmotion.y - ocy - 2 * c->bw + 1), 1);
if (horizcorner && ev.xmotion.x > ocx2)
nx = ocx2 - (nw = c->minw);
if (vertcorner && ev.xmotion.y > ocy2)
ny = ocy2 - (nh = c->minh);
if (c->mon->wx + nw >= selmon->wx && c->mon->wx + nw <= selmon->wx + selmon->ww if (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) && c->mon->wy + nh >= selmon->wy && c->mon->wy + nh <= selmon->wy + selmon->wh)
{ {
@ -1449,7 +1454,7 @@ resizemouse(const Arg *arg)
togglefloating(NULL); togglefloating(NULL);
} }
if (!selmon->lt[selmon->sellt]->arrange || c->isfloating) if (!selmon->lt[selmon->sellt]->arrange || c->isfloating)
resize(c, c->x, c->y, nw, nh, 1); resize(c, nx, ny, nw, nh, 1);
break; break;
} }
} while (ev.type != ButtonRelease); } while (ev.type != ButtonRelease);

BIN
dwm.o

Binary file not shown.