Compare commits

...

2 Commits

Author SHA1 Message Date
Jakub
684ff9bb71 make drag mfact compatible with pertag 2024-05-16 22:52:37 -04:00
Jakub
3d0629b664 have drag m fact live redraw 2024-05-16 22:52:37 -04:00

12
dwm.c
View File

@ -1670,6 +1670,7 @@ void
resizemouse(const Arg *arg)
{
int ocx, ocy, nw, nh;
unsigned int i;
Client *c;
Monitor *m;
XEvent ev;
@ -1713,6 +1714,15 @@ resizemouse(const Arg *arg)
if (!selmon->lt[selmon->sellt]->arrange || c->isfloating)
resize(c, c->x, c->y, nw, nh, 1);
else {
selmon->mfact = (double) (ev.xmotion.x_root - selmon->mx) / (double) selmon->ww;
for(i=0; i<LENGTH(tags); ++i)
if(selmon->tagset[selmon->seltags] & 1<<i)
selmon->pertag->mfacts[i+1] = selmon->mfact;
if(selmon->pertag->curtag == 0)
selmon->pertag->mfacts[0] = selmon->mfact;
arrange(selmon);
}
break;
}
} while (ev.type != ButtonRelease);
@ -1720,8 +1730,6 @@ resizemouse(const Arg *arg)
if (c->isfloating || NULL == c->mon->lt[c->mon->sellt]->arrange) {
XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1);
} else {
selmon->mfact = (double) (ev.xmotion.x_root - selmon->mx) / (double) selmon->ww;
arrange(selmon);
XWarpPointer(dpy, None, root, 0, 0, 0, 0,
selmon->mx + (selmon->ww * selmon->mfact),
selmon->my + (selmon->wh / 2)