diff options
| author | bakkeby <[email protected]> | 2019-09-11 00:51:37 +0200 |
|---|---|---|
| committer | bakkeby <[email protected]> | 2019-09-11 00:51:37 +0200 |
| commit | 5d33aebaafbc042cf576a76fbdf4ae64ef5cfff1 (patch) | |
| tree | 2353a6e57314546ef121e2d5f25b9c34c4297940 /patch | |
| parent | d0757568ee2680e50d142a32ec7c759439431399 (diff) | |
| download | dwm-flexipatch-5d33aebaafbc042cf576a76fbdf4ae64ef5cfff1.tar.gz dwm-flexipatch-5d33aebaafbc042cf576a76fbdf4ae64ef5cfff1.zip | |
Adding float border color patch
Diffstat (limited to 'patch')
| -rw-r--r-- | patch/cyclelayouts.c | 13 | ||||
| -rw-r--r-- | patch/fibonacci.c | 4 | ||||
| -rw-r--r-- | patch/gapplessgrid.c | 21 | ||||
| -rw-r--r-- | patch/horizgrid.c | 14 | ||||
| -rw-r--r-- | patch/systray.c | 16 |
5 files changed, 36 insertions, 32 deletions
diff --git a/patch/cyclelayouts.c b/patch/cyclelayouts.c index 4fdc873..bd33bfe 100644 --- a/patch/cyclelayouts.c +++ b/patch/cyclelayouts.c @@ -1,16 +1,17 @@ void -cyclelayout(const Arg *arg) { +cyclelayout(const Arg *arg) +{ Layout *l; - for(l = (Layout *)layouts; l != selmon->lt[selmon->sellt]; l++); - if(arg->i > 0) { - if(l->symbol && (l + 1)->symbol) + for (l = (Layout *)layouts; l != selmon->lt[selmon->sellt]; l++); + if (arg->i > 0) { + if (l->symbol && (l + 1)->symbol) setlayout(&((Arg) { .v = (l + 1) })); else setlayout(&((Arg) { .v = layouts })); } else { - if(l != layouts && (l - 1)->symbol) + if (l != layouts && (l - 1)->symbol) setlayout(&((Arg) { .v = (l - 1) })); else setlayout(&((Arg) { .v = &layouts[LENGTH(layouts) - 2] })); } -}
\ No newline at end of file +} diff --git a/patch/fibonacci.c b/patch/fibonacci.c index bc911a9..a8f3a06 100644 --- a/patch/fibonacci.c +++ b/patch/fibonacci.c @@ -90,7 +90,7 @@ fibonacci(Monitor *mon, int s) ny += nh; } if ((i % 4) == 0) { - if(s) + if (s) ny += nh; else ny -= nh; @@ -134,4 +134,4 @@ spiral(Monitor *m) { fibonacci(m, 0); } -#endif
\ No newline at end of file +#endif diff --git a/patch/gapplessgrid.c b/patch/gapplessgrid.c index 52cb627..2757ac4 100644 --- a/patch/gapplessgrid.c +++ b/patch/gapplessgrid.c @@ -39,19 +39,20 @@ gaplessgrid(Monitor *m) } #else void -gaplessgrid(Monitor *m) { +gaplessgrid(Monitor *m) +{ unsigned int n, cols, rows, cn, rn, i, cx, cy, cw, ch; Client *c; - for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++) ; - if(n == 0) + for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++) ; + if (n == 0) return; /* grid dimensions */ - for(cols = 0; cols <= n/2; cols++) - if(cols*cols >= n) + for (cols = 0; cols <= n/2; cols++) + if (cols*cols >= n) break; - if(n == 5) /* set layout against the general calculation: not 1:2:2, but 2:3 */ + if (n == 5) /* set layout against the general calculation: not 1:2:2, but 2:3 */ cols = 2; rows = n/cols; @@ -59,18 +60,18 @@ gaplessgrid(Monitor *m) { cw = cols ? m->ww / cols : m->ww; cn = 0; /* current column number */ rn = 0; /* current row number */ - for(i = 0, c = nexttiled(m->clients); c; i++, c = nexttiled(c->next)) { - if(i/rows + 1 > cols - n%cols) + for (i = 0, c = nexttiled(m->clients); c; i++, c = nexttiled(c->next)) { + if (i/rows + 1 > cols - n%cols) rows = n/cols + 1; ch = rows ? m->wh / rows : m->wh; cx = m->wx + cn*cw; cy = m->wy + rn*ch; resize(c, cx, cy, cw - 2 * c->bw, ch - 2 * c->bw, False); rn++; - if(rn >= rows) { + if (rn >= rows) { rn = 0; cn++; } } } -#endif
\ No newline at end of file +#endif diff --git a/patch/horizgrid.c b/patch/horizgrid.c index 60eea1c..586a2b0 100644 --- a/patch/horizgrid.c +++ b/patch/horizgrid.c @@ -55,14 +55,14 @@ horizgrid(Monitor *m) { int ntop, nbottom = 0; /* Count windows */ - for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); + for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); - if(n == 0) + if (n == 0) return; - else if(n == 1) { /* Just fill the whole screen */ + else if (n == 1) { /* Just fill the whole screen */ c = nexttiled(m->clients); resize(c, m->wx, m->wy, m->ww - (2*c->bw), m->wh - (2*c->bw), False); - } else if(n == 2) { /* Split vertically */ + } else if (n == 2) { /* Split vertically */ w = m->ww / 2; c = nexttiled(m->clients); resize(c, m->wx, m->wy, w - (2*c->bw), m->wh - (2*c->bw), False); @@ -71,12 +71,12 @@ horizgrid(Monitor *m) { } else { ntop = n / 2; nbottom = n - ntop; - for(i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) { - if(i < ntop) + for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) { + if (i < ntop) resize(c, m->wx + i * m->ww / ntop, m->wy, m->ww / ntop - (2*c->bw), m->wh / 2 - (2*c->bw), False); else resize(c, m->wx + (i - ntop) * m->ww / nbottom, m->wy + m->wh / 2, m->ww / nbottom - (2*c->bw), m->wh / 2 - (2*c->bw), False); } } } -#endif
\ No newline at end of file +#endif diff --git a/patch/systray.c b/patch/systray.c index c96509d..0e70539 100644 --- a/patch/systray.c +++ b/patch/systray.c @@ -38,17 +38,18 @@ resizerequest(XEvent *e) } Monitor * -systraytomon(Monitor *m) { +systraytomon(Monitor *m) +{ Monitor *t; int i, n; - if(!systraypinning) { - if(!m) + if (!systraypinning) { + if (!m) return selmon; return m == selmon ? m : NULL; } - for(n = 1, t = mons; t && t->next; n++, t = t->next) ; - for(i = 1, t = mons; t && t->next && i < systraypinning; i++, t = t->next) ; - if(systraypinningfailfirst && n < systraypinning) + for (n = 1, t = mons; t && t->next; n++, t = t->next) ; + for (i = 1, t = mons; t && t->next && i < systraypinning; i++, t = t->next) ; + if (systraypinningfailfirst && n < systraypinning) return mons; return t; } @@ -184,7 +185,8 @@ updatesystrayiconstate(Client *i, XPropertyEvent *ev) } Client * -wintosystrayicon(Window w) { +wintosystrayicon(Window w) +{ Client *i = NULL; if (!showsystray || !w) |
