have drag m fact live redraw

This commit is contained in:
Jakub 2024-05-15 06:33:30 -04:00
parent 8b5f4911c1
commit 1241bda940

6
dwm.c
View File

@ -1717,6 +1717,10 @@ resizemouse(const Arg *arg)
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, c->x, c->y, nw, nh, 1);
else {
selmon->mfact = (double) (ev.xmotion.x_root - selmon->mx) / (double) selmon->ww;
arrange(selmon);
}
break; break;
} }
} while (ev.type != ButtonRelease); } while (ev.type != ButtonRelease);
@ -1724,8 +1728,6 @@ resizemouse(const Arg *arg)
if (c->isfloating || NULL == c->mon->lt[c->mon->sellt]->arrange) { 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); XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1);
} else { } else {
selmon->mfact = (double) (ev.xmotion.x_root - selmon->mx) / (double) selmon->ww;
arrange(selmon);
XWarpPointer(dpy, None, root, 0, 0, 0, 0, XWarpPointer(dpy, None, root, 0, 0, 0, 0,
selmon->mx + (selmon->ww * selmon->mfact), selmon->mx + (selmon->ww * selmon->mfact),
selmon->my + (selmon->wh / 2) selmon->my + (selmon->wh / 2)