wmii

git clone git://oldgit.suckless.org/wmii/
Log | Files | Refs | README | LICENSE

commit 01e86be56331b88d53a605e8069b8e6d68c44170
parent a1ace98236ff12d980dbc0de4d219efb625eae31
Author: Kris Maglione <jg@suckless.org>
Date:   Tue,  6 Mar 2007 15:06:27 -0500

Added an extra call to XPending in the X event loop to fix an apparant Xlib bug. Removed some debugging statements. Some minor fixes.

Diffstat:
9menu.c | 2+-
area.c | 9+--------
event.c | 1+
fs.c | 2+-
view.c | 11+++++++----
wmii.h | 9++++++++-
6 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/9menu.c b/9menu.c @@ -464,7 +464,7 @@ create_window(int wide, int high) h = high * numitems; XQueryPointer(dpy, root, &wdummy, &wdummy, &x, &y, - &dummy, &dummy, &dummy); + &dummy, &dummy, (uint*)&dummy); x -= wide / 2; if (x < 0) x = 0; diff --git a/area.c b/area.c @@ -144,15 +144,8 @@ attach_to_area(Area *a, Frame *f, Bool send) { insert_frame(a->sel, f, False); - if(a->floating) { - fprintf(stderr, "a: f=%p (%s) %d,%d %dx%d\n", - f, f->client->name, - f->rect.x, f->rect.y, f->rect.width, f->rect.height); + if(a->floating) place_frame(f); - fprintf(stderr, "b: f=%p (%s) %d,%d %dx%d\n", - f, f->client->name, - f->rect.x, f->rect.y, f->rect.width, f->rect.height); - } focus_frame(f, False); resize_frame(f, &f->rect); diff --git a/event.c b/event.c @@ -440,5 +440,6 @@ check_x_event(IXPConn *c) { printevent(&ev); if(handler[ev.type]) handler[ev.type](&ev); + XPending(blz.dpy); } } diff --git a/fs.c b/fs.c @@ -209,7 +209,7 @@ write_to_buf(P9Req *r, void *buf, uint *len, uint max) { buf = *(void **)buf; } - memcpy(buf + offset, r->ifcall.data, count); + memcpy((uchar*)buf + offset, r->ifcall.data, count); r->ofcall.count = count; ((char *)buf)[offset+count] = '\0'; } diff --git a/view.c b/view.c @@ -309,7 +309,7 @@ view_index(View *v) { a_i, (uint)f->client->win, r->y, r->height, f->client->props); if(len - n < 0) - return (uchar *)buffer; + return (uchar*)buffer; buf_i += n; len -= n; } @@ -344,11 +344,14 @@ area_of_message(View *v, char *message, uint *next) { *next = 4; return v->sel; } - if(!strncmp(message, "~ ", 2)) + if(!strncmp(message, "~ ", 2)) { + *next = 2; return v->area; - if(1 != sscanf(message, "%d %n", &i, next) || i == 0) + } + if(1 != sscanf(message, "%u %n", &i, next) || i == 0) return nil; - for(a=v->area; i && a; a=a->next, i--); + for(a=v->area; i && a; a=a->next) + i--; return a; } diff --git a/wmii.h b/wmii.h @@ -13,6 +13,12 @@ #define nil ((void*)0) /* Types */ +#undef uchar +#undef ushort +#undef uint +#undef ulong +#undef uvlong +#undef vlong #define uchar _wmiiuchar #define ushort _wmiiushort #define uint _wmiiuint @@ -31,7 +37,6 @@ typedef long long vlong; #define BLITZ_NORMCOLORS "#222222 #eeeeee #666666" typedef struct Blitz Blitz; -typedef enum BlitzAlign BlitzAlign; typedef struct BlitzColor BlitzColor; typedef struct BlitzFont BlitzFont; typedef struct BlitzBrush BlitzBrush; @@ -54,6 +59,8 @@ enum BlitzAlign { CENTER = NEAST | SWEST }; +typedef enum BlitzAlign BlitzAlign; + struct BlitzColor { vlong bg; vlong fg;