Compare commits
2 Commits
7ffccdd3c9
...
684ff9bb71
Author | SHA1 | Date | |
---|---|---|---|
|
684ff9bb71 | ||
|
3d0629b664 |
12
dwm.c
12
dwm.c
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user