mirror of
https://github.com/mintycube/dwm.git
synced 2024-10-22 14:05:45 +02:00
Adding dragmfact patch
This commit is contained in:
parent
3726d8d1ea
commit
9e53b46e35
@ -15,6 +15,8 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
|
|||||||
|
|
||||||
### Changelog:
|
### Changelog:
|
||||||
|
|
||||||
|
2019-10-24 - Added dragmfact patch
|
||||||
|
|
||||||
2019-10-22 - Added ispermanent and swallow patches
|
2019-10-22 - Added ispermanent and swallow patches
|
||||||
|
|
||||||
2019-10-16 - Introduced [flexipatch-finalizer](https://github.com/bakkeby/flexipatch-finalizer)
|
2019-10-16 - Introduced [flexipatch-finalizer](https://github.com/bakkeby/flexipatch-finalizer)
|
||||||
@ -113,6 +115,9 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
|
|||||||
- [cyclelayouts](https://dwm.suckless.org/patches/cyclelayouts/)
|
- [cyclelayouts](https://dwm.suckless.org/patches/cyclelayouts/)
|
||||||
- lets you cycle through all your layouts
|
- lets you cycle through all your layouts
|
||||||
|
|
||||||
|
- [dragmfact](https://dwm.suckless.org/patches/dragmfact/)
|
||||||
|
- lets you resize the split in the tile layout (i.e. modify mfact) by holding the modkey and dragging the mouse
|
||||||
|
|
||||||
- [dwmc](http://dwm.suckless.org/patches/dwmc/)
|
- [dwmc](http://dwm.suckless.org/patches/dwmc/)
|
||||||
- a simple dwmc client using a fork of fsignal to communicate with dwm
|
- a simple dwmc client using a fork of fsignal to communicate with dwm
|
||||||
|
|
||||||
|
46
dwm.c
46
dwm.c
@ -2333,9 +2333,25 @@ resizemouse(const Arg *arg)
|
|||||||
return;
|
return;
|
||||||
horizcorner = nx < c->w / 2;
|
horizcorner = nx < c->w / 2;
|
||||||
vertcorner = ny < c->h / 2;
|
vertcorner = ny < c->h / 2;
|
||||||
|
#if DRAGMFACT_PATCH
|
||||||
|
if (c->isfloating || NULL == c->mon->lt[c->mon->sellt]->arrange) {
|
||||||
|
XWarpPointer (dpy, None, c->win, 0, 0, 0, 0,
|
||||||
|
horizcorner ? (-c->bw) : (c->w + c->bw - 1),
|
||||||
|
vertcorner ? (-c->bw) : (c->h + c->bw - 1));
|
||||||
|
} else {
|
||||||
|
XWarpPointer(dpy, None, root, 0, 0, 0, 0, selmon->mw * selmon->mfact, selmon->mh / 2);
|
||||||
|
}
|
||||||
|
#else
|
||||||
XWarpPointer (dpy, None, c->win, 0, 0, 0, 0,
|
XWarpPointer (dpy, None, c->win, 0, 0, 0, 0,
|
||||||
horizcorner ? (-c->bw) : (c->w + c->bw - 1),
|
horizcorner ? (-c->bw) : (c->w + c->bw - 1),
|
||||||
vertcorner ? (-c->bw) : (c->h + c->bw - 1));
|
vertcorner ? (-c->bw) : (c->h + c->bw - 1));
|
||||||
|
#endif // DRAGMFACT_PATCH
|
||||||
|
#elif DRAGMFACT_PATCH
|
||||||
|
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 {
|
||||||
|
XWarpPointer(dpy, None, root, 0, 0, 0, 0, selmon->mw * selmon->mfact, selmon->mh / 2);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
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);
|
||||||
#endif // RESIZECORNERS_PATCH
|
#endif // RESIZECORNERS_PATCH
|
||||||
@ -2360,6 +2376,7 @@ resizemouse(const Arg *arg)
|
|||||||
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);
|
||||||
#endif // RESIZECORNERS_PATCH
|
#endif // RESIZECORNERS_PATCH
|
||||||
|
#if !DRAGMFACT_PATCH
|
||||||
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)
|
||||||
{
|
{
|
||||||
@ -2367,6 +2384,7 @@ resizemouse(const Arg *arg)
|
|||||||
&& (abs(nw - c->w) > snap || abs(nh - c->h) > snap))
|
&& (abs(nw - c->w) > snap || abs(nh - c->h) > snap))
|
||||||
togglefloating(NULL);
|
togglefloating(NULL);
|
||||||
}
|
}
|
||||||
|
#endif // DRAGMFACT_PATCH
|
||||||
if (!selmon->lt[selmon->sellt]->arrange || c->isfloating) {
|
if (!selmon->lt[selmon->sellt]->arrange || c->isfloating) {
|
||||||
#if RESIZECORNERS_PATCH
|
#if RESIZECORNERS_PATCH
|
||||||
resize(c, nx, ny, nw, nh, 1);
|
resize(c, nx, ny, nw, nh, 1);
|
||||||
@ -2391,9 +2409,29 @@ resizemouse(const Arg *arg)
|
|||||||
}
|
}
|
||||||
} while (ev.type != ButtonRelease);
|
} while (ev.type != ButtonRelease);
|
||||||
#if RESIZECORNERS_PATCH
|
#if RESIZECORNERS_PATCH
|
||||||
|
#if DRAGMFACT_PATCH
|
||||||
|
if (c->isfloating || NULL == c->mon->lt[c->mon->sellt]->arrange) {
|
||||||
|
XWarpPointer(dpy, None, c->win, 0, 0, 0, 0,
|
||||||
|
horizcorner ? (-c->bw) : (c->w + c->bw - 1),
|
||||||
|
vertcorner ? (-c->bw) : (c->h + c->bw - 1));
|
||||||
|
} else {
|
||||||
|
selmon->mfact = (double) ev.xmotion.x / (double) selmon->mw;
|
||||||
|
arrange(selmon);
|
||||||
|
XWarpPointer(dpy, None, root, 0, 0, 0, 0, selmon->mw * selmon->mfact, selmon->mh / 2);
|
||||||
|
}
|
||||||
|
#else
|
||||||
XWarpPointer(dpy, None, c->win, 0, 0, 0, 0,
|
XWarpPointer(dpy, None, c->win, 0, 0, 0, 0,
|
||||||
horizcorner ? (-c->bw) : (c->w + c->bw - 1),
|
horizcorner ? (-c->bw) : (c->w + c->bw - 1),
|
||||||
vertcorner ? (-c->bw) : (c->h + c->bw - 1));
|
vertcorner ? (-c->bw) : (c->h + c->bw - 1));
|
||||||
|
#endif // DRAGMFACT_PATCH
|
||||||
|
#elif DRAGMFACT_PATCH
|
||||||
|
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 / (double) selmon->mw;
|
||||||
|
arrange(selmon);
|
||||||
|
XWarpPointer(dpy, None, root, 0, 0, 0, 0, selmon->mw * selmon->mfact, selmon->mh / 2);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
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);
|
||||||
#endif // RESIZECORNERS_PATCH
|
#endif // RESIZECORNERS_PATCH
|
||||||
|
@ -115,6 +115,13 @@
|
|||||||
*/
|
*/
|
||||||
#define CYCLELAYOUTS_PATCH 0
|
#define CYCLELAYOUTS_PATCH 0
|
||||||
|
|
||||||
|
/* This patch lets you resize the split in the tile layout (i.e. modify mfact) by holding
|
||||||
|
* the modkey and dragging the mouse.
|
||||||
|
* This patch can be a bit wonky with other layouts, but generally works.
|
||||||
|
* https://dwm.suckless.org/patches/dragmfact/
|
||||||
|
*/
|
||||||
|
#define DRAGMFACT_PATCH 0
|
||||||
|
|
||||||
/* Simple dwmc client using a fork of fsignal to communicate with dwm.
|
/* Simple dwmc client using a fork of fsignal to communicate with dwm.
|
||||||
* To use this either copy the patch/dwmc shell script to somewhere in your path or
|
* To use this either copy the patch/dwmc shell script to somewhere in your path or
|
||||||
* uncomment the following line in Makefile: #cp -f patch/dwmc ${DESTDIR}${PREFIX}/bin
|
* uncomment the following line in Makefile: #cp -f patch/dwmc ${DESTDIR}${PREFIX}/bin
|
||||||
|
Loading…
Reference in New Issue
Block a user