Browse Source

new stuff, fixed several issues

config
Anselm R. Garbe 18 years ago
parent
commit
b1701adf75
6 changed files with 13 additions and 12 deletions
  1. +2
    -2
      client.c
  2. +1
    -1
      config.mk
  3. +1
    -0
      draw.c
  4. +4
    -4
      event.c
  5. +3
    -2
      util.c
  6. +2
    -3
      wm.c

+ 2
- 2
client.c View File

@ -44,8 +44,8 @@ arrange(void *aux)
else else
cols = rows; cols = rows;
gw = (sw - 2 * c->border) / cols;
gh = (sh - bh - 2 * c->border) / rows;
gw = (sw - 2) / cols;
gh = (sh - bh - 2) / rows;
for(i = j = 0, c = clients; c; c = c->next) { for(i = j = 0, c = clients; c; c = c->next) {
c->x = i * gw; c->x = i * gw;


+ 1
- 1
config.mk View File

@ -14,7 +14,7 @@ VERSION = 0.0
LIBS = -L${PREFIX}/lib -L/usr/lib -lc -lm -L${X11LIB} -lX11 LIBS = -L${PREFIX}/lib -L/usr/lib -lc -lm -L${X11LIB} -lX11
# Linux/BSD # Linux/BSD
CFLAGS = -g -Wall -I. -I${PREFIX}/include -I/usr/include -I${X11INC} \
CFLAGS = -g -Wall -O2 -I. -I${PREFIX}/include -I/usr/include -I${X11INC} \
-DVERSION=\"${VERSION}\" -DVERSION=\"${VERSION}\"
LDFLAGS = -g ${LIBS} LDFLAGS = -g ${LIBS}


+ 1
- 0
draw.c View File

@ -39,6 +39,7 @@ draw(Display *dpy, Brush *b, Bool border, const char *text)
XSetForeground(dpy, b->gc, b->bg); XSetForeground(dpy, b->gc, b->bg);
XFillRectangles(dpy, b->drawable, b->gc, &r, 1); XFillRectangles(dpy, b->drawable, b->gc, &r, 1);
w = 0;
if(border) if(border)
drawborder(dpy, b); drawborder(dpy, b);


+ 4
- 4
event.c View File

@ -186,11 +186,11 @@ propertynotify(XEvent *e)
if(ev->state == PropertyDelete) if(ev->state == PropertyDelete)
return; /* ignore */ return; /* ignore */
if(ev->atom == wm_atom[WMProtocols]) {
c->proto = win_proto(c->win);
return;
}
if((c = getclient(ev->window))) { if((c = getclient(ev->window))) {
if(ev->atom == wm_atom[WMProtocols]) {
c->proto = win_proto(c->win);
return;
}
switch (ev->atom) { switch (ev->atom) {
default: break; default: break;
case XA_WM_TRANSIENT_FOR: case XA_WM_TRANSIENT_FOR:


+ 3
- 2
util.c View File

@ -126,13 +126,14 @@ pipe_spawn(char *buf, unsigned int len, Display *dpy, char *argv[])
perror(" failed"); perror(" failed");
} }
else { else {
n = 0;
l = n = 0;
close(pfd[1]); close(pfd[1]);
while(l > n) {
while(n < len) {
if((l = read(pfd[0], buf + n, len - n)) < 1) if((l = read(pfd[0], buf + n, len - n)) < 1)
break; break;
n += l; n += l;
} }
while(l > n);
close(pfd[0]); close(pfd[0]);
buf[n < len ? n : len - 1] = 0; buf[n < len ? n : len - 1] = 0;
} }


+ 2
- 3
wm.c View File

@ -95,13 +95,12 @@ win_property(Window w, Atom a, Atom t, long l, unsigned char **prop)
int int
win_proto(Window w) win_proto(Window w)
{ {
Atom *protocols;
unsigned char *protocols;
long res; long res;
int protos = 0; int protos = 0;
int i; int i;
res = win_property(w, wm_atom[WMProtocols], XA_ATOM, 20L,
((unsigned char **) &protocols));
res = win_property(w, wm_atom[WMProtocols], XA_ATOM, 20L, &protocols);
if(res <= 0) { if(res <= 0) {
return protos; return protos;
} }


Loading…
Cancel
Save