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

From: Kris Maglione <jg_AT_suckless.org>
Date: Tue Mar 06 21:07:09 2007

changeset: 2005:93c62bd610c2
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Tue Mar 06 15:06:27 2007 -0500
summary: Added an extra call to XPending in the X event loop to fix an apparant Xlib bug. Removed some debugging statements. Some minor fixes.

diff -r 3fdda9bcf3c8 -r 93c62bd610c2 9menu.c
--- a/9menu.c Tue Mar 06 14:20:49 2007 -0500
+++ b/9menu.c Tue Mar 06 15:06:27 2007 -0500
@@ -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 -r 3fdda9bcf3c8 -r 93c62bd610c2 area.c
--- a/area.c Tue Mar 06 14:20:49 2007 -0500
+++ b/area.c Tue Mar 06 15:06:27 2007 -0500
@@ -144,15 +144,8 @@ attach_to_area(Area *a, Frame *f, Bool s
 
         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 -r 3fdda9bcf3c8 -r 93c62bd610c2 event.c
--- a/event.c Tue Mar 06 14:20:49 2007 -0500
+++ b/event.c Tue Mar 06 15:06:27 2007 -0500
@@ -440,5 +440,6 @@ check_x_event(IXPConn *c) {
                         printevent(&ev);
                 if(handler[ev.type])
                         handler[ev.type](&ev);
- }
-}
+ XPending(blz.dpy);
+ }
+}
diff -r 3fdda9bcf3c8 -r 93c62bd610c2 fs.c
--- a/fs.c Tue Mar 06 14:20:49 2007 -0500
+++ b/fs.c Tue Mar 06 15:06:27 2007 -0500
@@ -209,7 +209,7 @@ write_to_buf(P9Req *r, void *buf, uint *
                 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 -r 3fdda9bcf3c8 -r 93c62bd610c2 view.c
--- a/view.c Tue Mar 06 14:20:49 2007 -0500
+++ b/view.c Tue Mar 06 15:06:27 2007 -0500
@@ -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,
                 *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 -r 3fdda9bcf3c8 -r 93c62bd610c2 wmii.h
--- a/wmii.h Tue Mar 06 14:20:49 2007 -0500
+++ b/wmii.h Tue Mar 06 15:06:27 2007 -0500
@@ -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;
@@ -53,6 +58,8 @@ enum BlitzAlign {
         SWEST = SOUTH | WEST,
         CENTER = NEAST | SWEST
 };
+
+typedef enum BlitzAlign BlitzAlign;
 
 struct BlitzColor {
         vlong bg;
Received on Tue Mar 06 2007 - 21:07:09 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:56:13 UTC