applied gap patch
This commit is contained in:
parent
26445a0dc9
commit
ad6e400505
6
Makefile
6
Makefile
@ -18,11 +18,7 @@ options:
|
||||
@echo CC $<
|
||||
@${CC} -c ${CFLAGS} $<
|
||||
|
||||
${OBJ}: config.h config.mk
|
||||
|
||||
config.h:
|
||||
@echo creating $@ from config.def.h
|
||||
@cp config.def.h $@
|
||||
${OBJ}: config.def.h config.mk
|
||||
|
||||
dwm: ${OBJ}
|
||||
@echo CC -o $@
|
||||
|
@ -9,6 +9,7 @@ static const char selbordercolor[] = "#005577";
|
||||
static const char selbgcolor[] = "#005577";
|
||||
static const char selfgcolor[] = "#eeeeee";
|
||||
static const unsigned int borderpx = 1; /* border pixel of windows */
|
||||
static const unsigned int gappx = 2; /* gap pixel between windows */
|
||||
static const unsigned int snap = 32; /* snap pixel */
|
||||
static const Bool showbar = True; /* False means no bar */
|
||||
static const Bool topbar = True; /* False means bottom bar */
|
||||
@ -47,7 +48,7 @@ static const Layout layouts[] = {
|
||||
|
||||
/* commands */
|
||||
static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
|
||||
static const char *termcmd[] = { "uxterm", NULL };
|
||||
static const char *termcmd[] = { "st", NULL };
|
||||
|
||||
static Key keys[] = {
|
||||
/* modifier key function argument */
|
||||
|
18
dwm.c
18
dwm.c
@ -285,7 +285,7 @@ static Monitor *mons = NULL, *selmon = NULL;
|
||||
static Window root;
|
||||
|
||||
/* configuration, allows nested code to access above variables */
|
||||
#include "config.h"
|
||||
#include "config.def.h"
|
||||
|
||||
/* compile-time check if all tags fit into an unsigned int bit array. */
|
||||
struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
|
||||
@ -1703,7 +1703,7 @@ textnw(const char *text, unsigned int len) {
|
||||
|
||||
void
|
||||
tile(Monitor *m) {
|
||||
unsigned int i, n, h, mw, my, ty;
|
||||
unsigned int i, n, h, r, g = 0, mw, my, ty;
|
||||
Client *c;
|
||||
|
||||
for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
|
||||
@ -1711,19 +1711,21 @@ tile(Monitor *m) {
|
||||
return;
|
||||
|
||||
if(n > m->nmaster)
|
||||
mw = m->nmaster ? m->ww * m->mfact : 0;
|
||||
mw = m->nmaster ? (m->ww - (g = gappx)) * m->mfact : 0;
|
||||
else
|
||||
mw = m->ww;
|
||||
for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
|
||||
if(i < m->nmaster) {
|
||||
h = (m->wh - my) / (MIN(n, m->nmaster) - i);
|
||||
r = MIN(n, m->nmaster) - i;
|
||||
h = (m->wh - my - gappx * (r - 1)) / r;
|
||||
resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), False);
|
||||
my += HEIGHT(c);
|
||||
my += HEIGHT(c) + gappx;
|
||||
}
|
||||
else {
|
||||
h = (m->wh - ty) / (n - i);
|
||||
resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), False);
|
||||
ty += HEIGHT(c);
|
||||
r = n - i;
|
||||
h = (m->wh - ty - gappx * (r - 1)) / r;
|
||||
resize(c, m->wx + mw + g, m->wy + ty, m->ww - mw - g - (2*c->bw), h - (2*c->bw), False);
|
||||
ty += HEIGHT(c) + gappx;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user