Compare commits

..

7 Commits
2.7 ... 2.8

8 changed files with 21 additions and 16 deletions

View File

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

View File

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

View File

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

View File

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

2
dwm.h
View File

@ -117,7 +117,7 @@ extern void killclient(Arg *arg); /* kill c nicely */
extern void manage(Window w, XWindowAttributes *wa); /* manage new client */
extern void resize(Client *c, Bool sizehints, Corner sticky); /* resize c*/
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 unmanage(Client *c); /* destroy c */

View File

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

6
main.c
View File

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

11
view.c
View File

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