Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- windowarea_margin patch for dwm 5.9
- Introduce margin around the "window area", to eliminate "double gaps" between
- client windows by doubling it on the window area edges too.
- m->gap is the gap in pixel around window area and client windows.
- The default value of this gap should be defined in config.h:
- static const unsigned int gappx = 3;
- Note that due to "double gaps", the gaps you see are the double size of gappx.
- diff -up a/dwm.c b/dwm.c
- --- a/dwm.c 2011-08-29 12:00:00.00 +0000
- +++ b/dwm.c 2011-08-29 12:00:00.00 +0000
- @@ -125,6 +125,7 @@ typedef struct {
- struct Monitor {
- char ltsymbol[16];
- float mfact;
- + int gap;
- int num;
- int by; /* bar geometry */
- int mx, my, mw, mh; /* screen size */
- @@ -1773,12 +1774,16 @@ updatebars(void) {
- void
- updatebarpos(Monitor *m) {
- - m->wy = m->my;
- - m->wh = m->mh;
- + m->wy = m->my + m->gap;
- + m->wh = m->mh - m->gap * 2;
- if(m->showbar) {
- m->wh -= bh;
- - m->by = m->topbar ? m->wy : m->wy + m->wh;
- - m->wy = m->topbar ? m->wy + bh : m->wy;
- + if(m->topbar) {
- + m->by = m->my;
- + m->wy += bh;
- + }
- + else
- + m->by = m->wy + m->wh + m->gap;
- }
- else
- m->by = -bh;
- @@ -1819,12 +1824,15 @@ updategeom(void) {
- || unique[i].width != m->mw || unique[i].height != m->mh))
- {
- dirty = True;
- + m->gap = gappx;
- m->num = i;
- m->mx = m->wx = unique[i].x_org;
- m->my = m->wy = unique[i].y_org;
- m->mw = m->ww = unique[i].width;
- m->mh = m->wh = unique[i].height;
- updatebarpos(m);
- + m->wx += m->gap;
- + m->ww -= m->gap * 2;
- }
- }
- else { /* less monitors available nn < n */
- @@ -1854,9 +1862,12 @@ updategeom(void) {
- mons = createmon();
- if(mons->mw != sw || mons->mh != sh) {
- dirty = True;
- + mons->gap = gappx;
- mons->mw = mons->ww = sw;
- mons->mh = mons->wh = sh;
- updatebarpos(mons);
- + mons->wx += mons->gap;
- + mons->ww -= mons->gap * 2;
- }
- }
- if(dirty) {
Add Comment
Please, Sign In to add comment