Compare commits

..

7 Commits
2.7 ... 2.8

8 changed files with 21 additions and 16 deletions

@ -26,3 +26,4 @@ a2c465098a3b972bbed00feda9804b6aae1e9531 2.1
dcbbfabc8ecc5f33a6cc950584de87da1a368045 2.5 dcbbfabc8ecc5f33a6cc950584de87da1a368045 2.5
c7f84f23ec5aef29988dcdc4ec22a7352ee8f58e 2.5.1 c7f84f23ec5aef29988dcdc4ec22a7352ee8f58e 2.5.1
5308dd22b6ee8e3218c81d9e7e4125f235bb5778 2.6 5308dd22b6ee8e3218c81d9e7e4125f235bb5778 2.6
21951c0dfbae5af68ed77821a4d87253ee91803f 2.7

@ -156,7 +156,7 @@ manage(Window w, XWindowAttributes *wa) {
c->w = c->tw = wa->width; c->w = c->tw = wa->width;
c->h = wa->height; c->h = wa->height;
c->th = bh; c->th = bh;
updatesize(c); updatesizehints(c);
if(c->x + c->w + 2 * BORDERPX > sw) if(c->x + c->w + 2 * BORDERPX > sw)
c->x = sw - c->w - 2 * BORDERPX; c->x = sw - c->w - 2 * BORDERPX;
if(c->x < sx) if(c->x < sx)
@ -256,7 +256,7 @@ resizetitle(Client *c) {
} }
void void
updatesize(Client *c) { updatesizehints(Client *c) {
long msize; long msize;
XSizeHints size; XSizeHints size;

@ -28,8 +28,8 @@ static Key key[] = { \
{ .cmd = "exec uxterm -bg black -fg '#eeeeee' -cr '#eeeeee' +sb -fn '"FONT"'" } }, \ { .cmd = "exec uxterm -bg black -fg '#eeeeee' -cr '#eeeeee' +sb -fn '"FONT"'" } }, \
{ MODKEY, XK_p, spawn, \ { MODKEY, XK_p, spawn, \
{ .cmd = "exe=\"$(lsx `echo $PATH | sed 's/:/ /g'` | sort -u " \ { .cmd = "exe=\"$(lsx `echo $PATH | sed 's/:/ /g'` | sort -u " \
" | dmenu -font '"FONT"' -normbg '"NORMBGCOLOR"' -normfg '"NORMFGCOLOR"' " \ " | dmenu -fn '"FONT"' -nb '"NORMBGCOLOR"' -nf '"NORMFGCOLOR"' " \
"-selbg '"SELBGCOLOR"' -selfg '"SELFGCOLOR"')\" && exec $exe" } }, \ "-sb '"SELBGCOLOR"' -sf '"SELFGCOLOR"')\" && exec $exe" } }, \
{ MODKEY, XK_j, focusnext, { 0 } }, \ { MODKEY, XK_j, focusnext, { 0 } }, \
{ MODKEY, XK_k, focusprev, { 0 } }, \ { MODKEY, XK_k, focusprev, { 0 } }, \
{ MODKEY, XK_Return, zoom, { 0 } }, \ { MODKEY, XK_Return, zoom, { 0 } }, \

@ -1,5 +1,5 @@
# dwm version # dwm version
VERSION = 2.7 VERSION = 2.8
# Customize below to fit your system # Customize below to fit your system
@ -20,6 +20,11 @@ LDFLAGS = ${LIBS}
#CFLAGS = -g -Wall -O2 ${INCS} -DVERSION=\"${VERSION}\" #CFLAGS = -g -Wall -O2 ${INCS} -DVERSION=\"${VERSION}\"
#LDFLAGS = -g ${LIBS} #LDFLAGS = -g ${LIBS}
# Solaris
#CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\"
#LDFLAGS = ${LIBS}
#CFLAGS += -xtarget=ultra
# compiler and linker # compiler and linker
CC = cc CC = cc
LD = ${CC} LD = ${CC}

2
dwm.h

@ -117,7 +117,7 @@ extern void killclient(Arg *arg); /* kill c nicely */
extern void manage(Window w, XWindowAttributes *wa); /* manage new client */ extern void manage(Window w, XWindowAttributes *wa); /* manage new client */
extern void resize(Client *c, Bool sizehints, Corner sticky); /* resize c*/ extern void resize(Client *c, Bool sizehints, Corner sticky); /* resize c*/
extern void resizetitle(Client *c); /* resizes c->twin correctly */ extern void resizetitle(Client *c); /* resizes c->twin correctly */
extern void updatesize(Client *c); /* update the size structs of c */ extern void updatesizehints(Client *c); /* update the size hint variables of c */
extern void updatetitle(Client *c); /* update the name of c */ extern void updatetitle(Client *c); /* update the name of c */
extern void unmanage(Client *c); /* destroy c */ extern void unmanage(Client *c); /* destroy c */

@ -314,7 +314,7 @@ propertynotify(XEvent *e) {
arrange(); arrange();
break; break;
case XA_WM_NORMAL_HINTS: case XA_WM_NORMAL_HINTS:
updatesize(c); updatesizehints(c);
break; break;
} }
if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) { if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) {

6
main.c

@ -40,9 +40,9 @@ static Bool otherwm, readin;
static void static void
cleanup(void) { cleanup(void) {
close(STDIN_FILENO); close(STDIN_FILENO);
while(sel) { while(clients) {
resize(sel, True, TopLeft); resize(clients, True, TopLeft);
unmanage(sel); unmanage(clients);
} }
if(dc.font.set) if(dc.font.set)
XFreeFontSet(dpy, dc.font.set); XFreeFontSet(dpy, dc.font.set);

11
view.c

@ -69,13 +69,12 @@ dofloat(void) {
void void
dotile(void) { dotile(void) {
unsigned int i, n, mpx, stackw, th; unsigned int i, n, mpw, th;
Client *c; Client *c;
for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next))
n++; n++;
mpx = (waw * master) / 1000; mpw = (waw * master) / 1000;
stackw = waw - mpx;
for(i = 0, c = clients; c; c = c->next) for(i = 0, c = clients; c; c = c->next)
if(isvisible(c)) { if(isvisible(c)) {
@ -91,13 +90,13 @@ dotile(void) {
c->h = wah - 2 * BORDERPX; c->h = wah - 2 * BORDERPX;
} }
else if(i == 0) { /* master window */ else if(i == 0) { /* master window */
c->w = mpx - 2 * BORDERPX; c->w = mpw - 2 * BORDERPX;
c->h = wah - 2 * BORDERPX; c->h = wah - 2 * BORDERPX;
th = wah / (n - 1); th = wah / (n - 1);
} }
else { /* tile window */ else { /* tile window */
c->x += mpx; c->x += mpw;
c->w = stackw - 2 * BORDERPX; c->w = (waw - mpw) - 2 * BORDERPX;
if(th > bh) { if(th > bh) {
c->y += (i - 1) * th; c->y += (i - 1) * th;
c->h = th - 2 * BORDERPX; c->h = th - 2 * BORDERPX;