[Xcb-commit] atom convenient icccm image keysyms property renderutil wm

Ian Osgood iano at kemper.freedesktop.org
Sat Oct 7 11:45:31 PDT 2006


 atom/atoms.gperf.m4        |   14 +-
 convenient/xcb_aux.c       |    4 
 icccm/icccm.c              |    8 -
 image/test_formats.c       |   14 +-
 image/test_xcb_image.c     |   22 ++--
 image/test_xcb_image_shm.c |   18 +--
 keysyms/keysyms.c          |  218 ++++++++++++++++++++++-----------------------
 property/prop.c            |    2 
 renderutil/cache.c         |    6 -
 renderutil/util.c          |   26 ++---
 wm/manage.c                |   18 +--
 wm/reply_formats.c         |   22 ++--
 wm/xcbwm-test.c            |   20 ++--
 13 files changed, 196 insertions(+), 196 deletions(-)

New commits:
diff-tree 8cbe72cf7dae11d3944a9f45973c11bcd3867952 (from 173bbad06f2a8e64e72589e07d237cc5c1706af3)
Author: Ian Osgood <iano at quirkster.com>
Date:   Sat Oct 7 11:45:07 2006 -0700

    Adapt xcb/util libraries for removal of XID structures.

diff --git a/atom/atoms.gperf.m4 b/atom/atoms.gperf.m4
index 5c433be..c22f745 100644
--- a/atom/atoms.gperf.m4
+++ b/atom/atoms.gperf.m4
@@ -4,7 +4,7 @@
 #include "xcb_atom.h"
 
 define(`COUNT', 0)dnl
-define(`DO', `const xcb_atom_t $1 = { define(`COUNT', incr(COUNT))COUNT };')dnl
+define(`DO', `const xcb_atom_t $1 = define(`COUNT', incr(COUNT))COUNT;')dnl
 include(atomlist.m4)`'dnl
 %}
 
@@ -18,7 +18,7 @@ include(atomlist.m4)`'dnl
 %struct-type
 struct atom_map { int name; xcb_atom_t value; };
 %%
-define(`DO', `$1,{ define(`COUNT', incr(COUNT))COUNT }')dnl
+define(`DO', `$1,define(`COUNT', incr(COUNT))COUNT')dnl
 include(atomlist.m4)`'dnl
 %%
 static const char *const atom_names[] = {
@@ -29,7 +29,7 @@ include(atomlist.m4)`'dnl
 xcb_atom_t intern_atom_predefined(uint16_t name_len, const char *name)
 {
 	const struct atom_map *value = in_word_set(name, name_len);
-	xcb_atom_t ret = { XCB_NONE };
+	xcb_atom_t ret = XCB_NONE;
 	if(value)
 		ret = value->value;
 	return ret;
@@ -39,7 +39,7 @@ intern_atom_fast_cookie_t intern_atom_fa
 {
 	intern_atom_fast_cookie_t cookie;
 
-	if((cookie.u.atom = intern_atom_predefined(name_len, name)).xid != XCB_NONE)
+	if((cookie.u.atom = intern_atom_predefined(name_len, name)) != XCB_NONE)
 	{
 		cookie.tag = TAG_VALUE;
 		return cookie;
@@ -67,7 +67,7 @@ xcb_atom_t intern_atom_fast_reply(xcb_co
 			free(reply);
 		}
 		else
-			cookie.u.atom.xid = 0;
+			cookie.u.atom = XCB_NONE;
 		break;
 	}
 	return cookie.u.atom;
@@ -75,9 +75,9 @@ xcb_atom_t intern_atom_fast_reply(xcb_co
 
 const char *get_atom_name_predefined(xcb_atom_t atom)
 {
-	if(atom.xid <= 0 || atom.xid > (sizeof(atom_names) / sizeof(*atom_names)))
+	if(atom <= 0 || atom > (sizeof(atom_names) / sizeof(*atom_names)))
 		return 0;
-	return atom_names[atom.xid - 1];
+	return atom_names[atom - 1];
 }
 
 int get_atom_name(xcb_connection_t *c, xcb_atom_t atom, const char **namep, int *lengthp)
diff --git a/convenient/xcb_aux.c b/convenient/xcb_aux.c
index 0a922c1..c84ef8a 100644
--- a/convenient/xcb_aux.c
+++ b/convenient/xcb_aux.c
@@ -14,7 +14,7 @@ xcb_aux_get_depth (xcb_connection_t *c,
   xcb_get_geometry_reply_t *geom;
   int                       depth;
 
-  drawable.window = screen->root;
+  drawable = screen->root;
   geom = xcb_get_geometry_reply (c, xcb_get_geometry(c, drawable), 0);
 
   if (!geom) {
@@ -57,7 +57,7 @@ xcb_aux_get_visualtype (xcb_connection_t
    
    iter = xcb_depth_visuals_iterator(depth);
    for (cur = 0 ; cur < iter.rem ; xcb_visualtype_next(&iter), ++cur)
-      if (vid.id == iter.data->visual_id.id)
+      if (vid == iter.data->visual_id)
 	 return iter.data;
 
    return NULL;
diff --git a/icccm/icccm.c b/icccm/icccm.c
index 9476d7d..63d4694 100644
--- a/icccm/icccm.c
+++ b/icccm/icccm.c
@@ -493,7 +493,7 @@ GetWMSizeHints (xcb_connection_t *c,
 	if (!rep)
 	        return 0;
 
-	if ((rep->type.xid == WM_SIZE_HINTS.xid) &&
+	if ((rep->type == WM_SIZE_HINTS) &&
 	    ((rep->format == 8)  ||
 	     (rep->format == 16) ||
 	     (rep->format == 32)) &&
@@ -781,7 +781,7 @@ GetWMHints (xcb_connection_t *c,
 	if (!rep)
 		return NULL;
 
-	if ((rep->type.xid != WM_HINTS.xid) ||
+	if ((rep->type != WM_HINTS) ||
 	    (rep->value_len < (NumWMHintsElements - 1)) ||
 	    (rep->format != 32))
 	{
@@ -800,7 +800,7 @@ GetWMHints (xcb_connection_t *c,
 	prop[length] = '\0';
 	hints = (WMHints *)strdup (prop);
 	if (rep->value_len < NumWMHintsElements)
-		hints->window_group.xid = 0;
+		hints->window_group = XCB_NONE;
 
 	return hints;
 }
@@ -843,7 +843,7 @@ GetWMProtocols (xcb_connection_t *c,
 	rep = xcb_get_property_reply(c, cookie, 0);
 	if (!rep)
 	        return 0;
-	if ((rep->type.xid == ATOM.xid) ||
+	if ((rep->type == ATOM) ||
 	    (rep->format == 32))
 	{
 	        int length;
diff --git a/image/test_formats.c b/image/test_formats.c
index 1176a79..b7a01ed 100644
--- a/image/test_formats.c
+++ b/image/test_formats.c
@@ -55,7 +55,7 @@ static xcb_window_t create_window(xcb_co
 	static const uint32_t mask = XCB_CW_EVENT_MASK;
 	static const uint32_t values[] = { XCB_EVENT_MASK_EXPOSURE };
 	unsigned int seq;
-	xcb_window_t w = xcb_window_new(c);
+	xcb_window_t w = xcb_generate_id(c);
 	seq = xcb_create_window(c, root->root_depth, w, root->root, 30, 30, WIDTH, HEIGHT, 0, XCB_WINDOW_CLASS_INPUT_OUTPUT, root->root_visual, mask, values).sequence;
 	printf("CreateWindow sequence %d, depth %d\n", seq, root->root_depth);
 	seq = xcb_map_window(c, w).sequence;
@@ -65,7 +65,7 @@ static xcb_window_t create_window(xcb_co
 
 static xcb_pixmap_t create_pixmap(xcb_connection_t *c, xcb_drawable_t d, uint8_t depth)
 {
-	xcb_pixmap_t p = xcb_pixmap_new(c);
+	xcb_pixmap_t p = xcb_generate_id(c);
 	unsigned int seq;
 	seq = xcb_create_pixmap(c, depth, p, d, WIDTH, HEIGHT).sequence;
 	printf("CreatePixmap sequence %d, depth %d\n", seq, depth);
@@ -78,7 +78,7 @@ static xcb_gcontext_t create_gcontext(xc
 	const uint32_t values[] = { root->black_pixel, root->white_pixel };
 	const xcb_drawable_t d = { root->root };
 	unsigned int seq;
-	xcb_gcontext_t gc = xcb_gcontext_new(c);
+	xcb_gcontext_t gc = xcb_generate_id(c);
 	seq = xcb_create_gc(c, gc, d, mask, values).sequence;
 	printf("CreateGC sequence %d\n", seq);
 	return gc;
@@ -89,7 +89,7 @@ int main(int argc, char **argv)
 	int screen, depth, format = XCB_IMAGE_FORMAT_Z_PIXMAP;
 	xcb_screen_t *root;
 	xcb_image_t *im;
-	xcb_drawable_t d, w = { { 0 } };
+	xcb_drawable_t d, w = XCB_NONE;
 	xcb_gcontext_t gc;
 	xcb_generic_event_t *ev;
 	xcb_connection_t *c = xcb_connect(0, &screen);
@@ -107,11 +107,11 @@ int main(int argc, char **argv)
 		depth = root->root_depth;
 
 	im = create_image(c, depth, format);
-	d.window = create_window(c, root);
+	d = create_window(c, root);
 	if(depth != root->root_depth)
 	{
 		w = d;
-		d.pixmap = create_pixmap(c, w, depth);
+		d = create_pixmap(c, w, depth);
 	}
 	gc = create_gcontext(c, root);
 	xcb_flush(c);
@@ -123,7 +123,7 @@ int main(int argc, char **argv)
 			if(ev->response_type == XCB_EXPOSE && ((xcb_expose_event_t *) ev)->count == 0)
 			{
 				xcb_image_put(c, d, gc, im, 0, 0, 0, 0, WIDTH, HEIGHT);
-				if(w.window.xid)
+				if(w)
 				{
 					unsigned int seq;
 					seq = xcb_copy_plane(c, d, w, gc, 0, 0, WIDTH, HEIGHT, 0, 0, 1).sequence;
diff --git a/image/test_xcb_image.c b/image/test_xcb_image.c
index d482634..f459489 100644
--- a/image/test_xcb_image.c
+++ b/image/test_xcb_image.c
@@ -129,22 +129,22 @@ main (int argc, char *argv[])
   depth = xcb_aux_get_depth (c, screen);
 
   /* Create a black graphic context for drawing in the foreground */
-  win.window = screen->root;
+  win = screen->root;
 
-  fgcolor = xcb_gcontext_new(c);
+  fgcolor = xcb_generate_id(c);
   mask = XCB_GC_FOREGROUND | XCB_GC_GRAPHICS_EXPOSURES;
   valgc[0] = screen->black_pixel;
   valgc[1] = 0; /* no graphics exposures */
   xcb_create_gc(c, fgcolor, win, mask, valgc);
 
-  bgcolor = xcb_gcontext_new(c);
+  bgcolor = xcb_generate_id(c);
   mask = XCB_GC_FOREGROUND | XCB_GC_GRAPHICS_EXPOSURES;
   valgc[0] = screen->white_pixel;
   valgc[1] = 0; /* no graphics exposures */
   xcb_create_gc(c, bgcolor, win, mask, valgc);
 
   /* Ask for our window's Id */
-  win.window = xcb_window_new(c);
+  win = xcb_generate_id(c);
 
   /* Create the window */
   mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK | XCB_CW_DONT_PROPAGATE;
@@ -153,7 +153,7 @@ main (int argc, char *argv[])
   valwin[2] = XCB_EVENT_MASK_BUTTON_PRESS;
   xcb_create_window (c,                        /* Connection          */
  		   0,                        /* depth               */
-		   win.window,               /* window Id           */
+		   win,                      /* window Id           */
 		   screen->root,             /* parent window       */
 		   0, 0,                     /* x, y                */
 		   W_W, W_H,                 /* width, height       */
@@ -163,11 +163,11 @@ main (int argc, char *argv[])
 		   mask, valwin);                 /* masks, not used yet */
 
   /* Map the window on the screen */
-  xcb_map_window (c, win.window);
+  xcb_map_window (c, win);
 
   /* Create a Pixmap that will fill the window */
-  rect.pixmap = xcb_pixmap_new (c);
-  xcb_create_pixmap(c, depth, rect.pixmap, win, W_W, W_H);
+  rect = xcb_generate_id (c);
+  xcb_create_pixmap(c, depth, rect, win, W_W, W_H);
   xcb_poly_fill_rectangle(c, rect, bgcolor, 1, &rect_coord);
   points[0].x = 0;
   points[0].y = 0;
@@ -181,7 +181,7 @@ main (int argc, char *argv[])
 /*   xcb_poly_line(c, CoordModeOrigin, rect, fgcolor, 2, points); */
 
   /* Ask for our window's Id */
-  new_win.window = xcb_window_new(c);
+  new_win = xcb_generate_id(c);
 
   /* Create the window */
   mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK | XCB_CW_DONT_PROPAGATE;
@@ -190,7 +190,7 @@ main (int argc, char *argv[])
   valwin[2] = XCB_EVENT_MASK_BUTTON_PRESS;
   xcb_create_window (c,                        /* Connection          */
  		   0,                        /* depth               */
-		   new_win.window,               /* window Id           */
+		   new_win,                  /* window Id           */
 		   screen->root,             /* parent window       */
 		   0, 0,                     /* x, y                */
 		   W_W, W_H,                 /* width, height       */
@@ -202,7 +202,7 @@ main (int argc, char *argv[])
   
 
   /* Map the window on the screen */
-  xcb_map_window (c, new_win.window);
+  xcb_map_window (c, new_win);
 
 
   xcb_flush (c); 
diff --git a/image/test_xcb_image_shm.c b/image/test_xcb_image_shm.c
index 1046e5a..ca5cd03 100644
--- a/image/test_xcb_image_shm.c
+++ b/image/test_xcb_image_shm.c
@@ -38,15 +38,15 @@ main (int argc, char *argv[])
   depth = xcb_aux_get_depth (c, screen);
 
   /* Create a black graphic context for drawing in the foreground */
-  win.window = screen->root;
+  win = screen->root;
 
-  fgcolor = xcb_gcontext_new(c);
+  fgcolor = xcb_generate_id(c);
   mask = XCB_GC_FOREGROUND | XCB_GC_GRAPHICS_EXPOSURES;
   valgc[0] = screen->black_pixel;
   valgc[1] = 0; /* no graphics exposures */
   xcb_create_gc(c, fgcolor, win, mask, valgc);
 
-  bgcolor = xcb_gcontext_new(c);
+  bgcolor = xcb_generate_id(c);
   mask = XCB_GC_FOREGROUND | XCB_GC_GRAPHICS_EXPOSURES;
   valgc[0] = screen->white_pixel;
   valgc[1] = 0; /* no graphics exposures */
@@ -85,7 +85,7 @@ main (int argc, char *argv[])
       shminfo.shmaddr = shmat(shminfo.shmid, 0, 0);
       img->data = shminfo.shmaddr;
 
-      shminfo.shmseg = xcb_shm_seg_new (c);
+      shminfo.shmseg = xcb_generate_id (c);
       xcb_shm_attach(c, shminfo.shmseg,
 		   shminfo.shmid, 0);
       shmctl(shminfo.shmid, IPC_RMID, 0);
@@ -103,7 +103,7 @@ main (int argc, char *argv[])
   printf ("fin put pixel\n");
 
   /* Ask for our window's Id */
-  win.window = xcb_window_new(c);
+  win = xcb_generate_id(c);
 
   /* Create the window */
   mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK | XCB_CW_DONT_PROPAGATE;
@@ -112,7 +112,7 @@ main (int argc, char *argv[])
   valwin[2] = XCB_EVENT_MASK_BUTTON_PRESS;
   xcb_create_window (c,                        /* Connection          */
  		   0,                        /* depth               */
-		   win.window,               /* window Id           */
+		   win,                      /* window Id           */
 		   screen->root,             /* parent window       */
 		   0, 0,                     /* x, y                */
 		   W_W, W_H,                 /* width, height       */
@@ -122,11 +122,11 @@ main (int argc, char *argv[])
 		   mask, valwin);            /* masks, not used yet */
 
   /* Map the window on the screen */
-  xcb_map_window (c, win.window);
+  xcb_map_window (c, win);
 
   /* Create a Pixmap that will fill the window */
-  rect.pixmap = xcb_pixmap_new (c);
-  xcb_create_pixmap(c, depth, rect.pixmap, win, W_W, W_H);
+  rect = xcb_generate_id (c);
+  xcb_create_pixmap(c, depth, rect, win, W_W, W_H);
   xcb_poly_fill_rectangle(c, rect, bgcolor, 1, &rect_coord);
   points[0].x = 0;
   points[0].y = 0;
diff --git a/keysyms/keysyms.c b/keysyms/keysyms.c
index 8faf202..83c1d3d 100644
--- a/keysyms/keysyms.c
+++ b/keysyms/keysyms.c
@@ -59,7 +59,7 @@ xcb_key_symbols_alloc (xcb_connection_t 
   
   syms->u.cookie = xcb_get_keyboard_mapping(c,
 					 min_keycode,
-					 max_keycode.id - min_keycode.id + 1);
+					 max_keycode - min_keycode + 1);
   
   return syms;
 }
@@ -158,7 +158,7 @@ xcb_keysym_t xcb_key_symbols_get_keysym 
 				  int            col)
 {
   xcb_keysym_t *keysyms;
-  xcb_keysym_t  keysym_null = { 0 };
+  xcb_keysym_t  keysym_null = { XCB_NO_SYMBOL };
   xcb_keysym_t  lsym;
   xcb_keysym_t  usym;
   xcb_keycode_t min_keycode;
@@ -176,26 +176,26 @@ xcb_keysym_t xcb_key_symbols_get_keysym 
 
   per = syms->u.reply->keysyms_per_keycode;
   if ((col < 0) || ((col >= per) && (col > 3)) ||
-      (keycode.id < min_keycode.id) ||
-      (keycode.id > max_keycode.id))
+      (keycode < min_keycode) ||
+      (keycode > max_keycode))
     return keysym_null;
 
-  keysyms = &keysyms[(keycode.id - min_keycode.id) * per];
+  keysyms = &keysyms[(keycode - min_keycode) * per];
   if (col < 4)
     {
       if (col > 1)
 	{
-	  while ((per > 2) && (keysyms[per - 1].id == 0))
+	  while ((per > 2) && (keysyms[per - 1] == XCB_NO_SYMBOL))
 	    per--;
 	  if (per < 3)
 	    col -= 2;
 	}
-      if ((per <= (col|1)) || (keysyms[col|1].id == 0))
+      if ((per <= (col|1)) || (keysyms[col|1] == XCB_NO_SYMBOL))
 	{
 	  xcb_convert_case(keysyms[col&~1], &lsym, &usym);
 	  if (!(col & 1))
 	    return lsym;
-	  else if (usym.id == lsym.id)
+	  else if (usym == lsym)
 	    return keysym_null;
 	  else
 	    return usym;
@@ -210,7 +210,7 @@ xcb_key_symbols_get_keycode (xcb_key_sym
 			 xcb_keysym_t      keysym)
 {
   xcb_keysym_t    ks;
-  xcb_keycode_t   keycode_null = { 0 };
+  xcb_keycode_t   keycode_null = { XCB_NO_SYMBOL };
   int          i, j;
 
   if (!syms)
@@ -220,13 +220,13 @@ xcb_key_symbols_get_keycode (xcb_key_sym
 
   for (j = 0; j < syms->u.reply->keysyms_per_keycode; j++)
     {
-      for (i = xcb_get_setup (syms->c)->min_keycode.id; i <= xcb_get_setup (syms->c)->max_keycode.id; i++)
+      for (i = xcb_get_setup (syms->c)->min_keycode; i <= xcb_get_setup (syms->c)->max_keycode; i++)
 	{
 	  xcb_keycode_t keycode;
 	  
-	  keycode.id = i;
+	  keycode = i;
 	  ks = xcb_key_symbols_get_keysym (syms, keycode, j);
-	  if (ks.id == keysym.id)
+	  if (ks == keysym)
 	    return keycode;
 	}
     }
@@ -269,7 +269,7 @@ xcb_refresh_keyboard_mapping (xcb_key_sy
   
       syms->u.cookie = xcb_get_keyboard_mapping(syms->c,
 					     min_keycode,
-					     max_keycode.id - min_keycode.id + 1);
+					     max_keycode - min_keycode + 1);
       
     }
     return 1;
@@ -283,46 +283,46 @@ xcb_refresh_keyboard_mapping (xcb_key_sy
 int
 xcb_is_keypad_key (xcb_keysym_t keysym)
 {
-  return ((keysym.id >= XK_KP_Space) && (keysym.id <= XK_KP_Equal));
+  return ((keysym >= XK_KP_Space) && (keysym <= XK_KP_Equal));
 }
 
 int
 xcb_is_private_keypad_key (xcb_keysym_t keysym)
 {
-  return ((keysym.id >= 0x11000000) && (keysym.id <= 0x1100FFFF));
+  return ((keysym >= 0x11000000) && (keysym <= 0x1100FFFF));
 }
 
 int
 xcb_is_cursor_key (xcb_keysym_t keysym)
 {
-  return ((keysym.id >= XK_Home) && (keysym.id <= XK_Select));
+  return ((keysym >= XK_Home) && (keysym <= XK_Select));
 }
 
 int
 xcb_is_pf_key (xcb_keysym_t keysym)
 {
-  return ((keysym.id >= XK_KP_F1) && (keysym.id <= XK_KP_F4));
+  return ((keysym >= XK_KP_F1) && (keysym <= XK_KP_F4));
 }
 
 int
 xcb_is_function_key (xcb_keysym_t keysym)
 {
-  return ((keysym.id >= XK_F1) && (keysym.id <= XK_F35));
+  return ((keysym >= XK_F1) && (keysym <= XK_F35));
 }
 
 int
 xcb_is_misc_function_key (xcb_keysym_t keysym)
 {
-  return ((keysym.id >= XK_Select) && (keysym.id <= XK_Break));
+  return ((keysym >= XK_Select) && (keysym <= XK_Break));
 }
 
 int
 xcb_is_modifier_key (xcb_keysym_t keysym)
 {
-  return  (((keysym.id >= XK_Shift_L)  && (keysym.id <= XK_Hyper_R)) ||
-	   ((keysym.id >= XK_ISO_Lock) && (keysym.id <= XK_ISO_Last_Group_Lock)) ||
-	   (keysym.id == XK_Mode_switch) ||
-	   (keysym.id == XK_Num_Lock));
+  return  (((keysym >= XK_Shift_L)  && (keysym <= XK_Hyper_R)) ||
+	   ((keysym >= XK_ISO_Lock) && (keysym <= XK_ISO_Last_Group_Lock)) ||
+	   (keysym == XK_Mode_switch) ||
+	   (keysym == XK_Num_Lock));
 }
 
 /* private functions */
@@ -332,107 +332,107 @@ xcb_convert_case(xcb_keysym_t  sym,
 	       xcb_keysym_t *lower,
 	       xcb_keysym_t *upper)
 {
-  lower->id = sym.id;
-  upper->id = sym.id;
+  *lower = sym;
+  *upper = sym;
 
-  switch(sym.id >> 8)
+  switch(sym >> 8)
     {
     case 0: /* Latin 1 */
-      if ((sym.id >= XK_A) && (sym.id <= XK_Z))
-	lower->id += (XK_a - XK_A);
-      else if ((sym.id >= XK_a) && (sym.id <= XK_z))
-	upper->id -= (XK_a - XK_A);
-      else if ((sym.id >= XK_Agrave) && (sym.id <= XK_Odiaeresis))
-	lower->id += (XK_agrave - XK_Agrave);
-      else if ((sym.id >= XK_agrave) && (sym.id <= XK_odiaeresis))
-	upper->id -= (XK_agrave - XK_Agrave);
-      else if ((sym.id >= XK_Ooblique) && (sym.id <= XK_Thorn))
-	lower->id += (XK_oslash - XK_Ooblique);
-      else if ((sym.id >= XK_oslash) && (sym.id <= XK_thorn))
-	upper->id -= (XK_oslash - XK_Ooblique);
+      if ((sym >= XK_A) && (sym <= XK_Z))
+	*lower += (XK_a - XK_A);
+      else if ((sym >= XK_a) && (sym <= XK_z))
+	*upper -= (XK_a - XK_A);
+      else if ((sym >= XK_Agrave) && (sym <= XK_Odiaeresis))
+	*lower += (XK_agrave - XK_Agrave);
+      else if ((sym >= XK_agrave) && (sym <= XK_odiaeresis))
+	*upper -= (XK_agrave - XK_Agrave);
+      else if ((sym >= XK_Ooblique) && (sym <= XK_Thorn))
+	*lower += (XK_oslash - XK_Ooblique);
+      else if ((sym >= XK_oslash) && (sym <= XK_thorn))
+	*upper -= (XK_oslash - XK_Ooblique);
       break;
     case 1: /* Latin 2 */
-      /* Assume the KeySym.Id is a legal value (ignore discontinuities) */
-      if (sym.id == XK_Aogonek)
-	lower->id = XK_aogonek;
-      else if (sym.id >= XK_Lstroke && sym.id <= XK_Sacute)
-	lower->id += (XK_lstroke - XK_Lstroke);
-      else if (sym.id >= XK_Scaron && sym.id <= XK_Zacute)
-	lower->id += (XK_scaron - XK_Scaron);
-      else if (sym.id >= XK_Zcaron && sym.id <= XK_Zabovedot)
-	lower->id += (XK_zcaron - XK_Zcaron);
-      else if (sym.id == XK_aogonek)
-	upper->id = XK_Aogonek;
-      else if (sym.id >= XK_lstroke && sym.id <= XK_sacute)
-	upper->id -= (XK_lstroke - XK_Lstroke);
-      else if (sym.id >= XK_scaron && sym.id <= XK_zacute)
-	upper->id -= (XK_scaron - XK_Scaron);
-      else if (sym.id >= XK_zcaron && sym.id <= XK_zabovedot)
-	upper->id -= (XK_zcaron - XK_Zcaron);
-      else if (sym.id >= XK_Racute && sym.id <= XK_Tcedilla)
-	lower->id += (XK_racute - XK_Racute);
-      else if (sym.id >= XK_racute && sym.id <= XK_tcedilla)
-	upper->id -= (XK_racute - XK_Racute);
+      /* Assume the KeySym is a legal value (ignore discontinuities) */
+      if (sym == XK_Aogonek)
+	*lower = XK_aogonek;
+      else if (sym >= XK_Lstroke && sym <= XK_Sacute)
+	*lower += (XK_lstroke - XK_Lstroke);
+      else if (sym >= XK_Scaron && sym <= XK_Zacute)
+	*lower += (XK_scaron - XK_Scaron);
+      else if (sym >= XK_Zcaron && sym <= XK_Zabovedot)
+	*lower += (XK_zcaron - XK_Zcaron);
+      else if (sym == XK_aogonek)
+	*upper = XK_Aogonek;
+      else if (sym >= XK_lstroke && sym <= XK_sacute)
+	*upper -= (XK_lstroke - XK_Lstroke);
+      else if (sym >= XK_scaron && sym <= XK_zacute)
+	*upper -= (XK_scaron - XK_Scaron);
+      else if (sym >= XK_zcaron && sym <= XK_zabovedot)
+	*upper -= (XK_zcaron - XK_Zcaron);
+      else if (sym >= XK_Racute && sym <= XK_Tcedilla)
+	*lower += (XK_racute - XK_Racute);
+      else if (sym >= XK_racute && sym <= XK_tcedilla)
+	*upper -= (XK_racute - XK_Racute);
       break;
     case 2: /* Latin 3 */
-      /* Assume the KeySym.Id is a legal value (ignore discontinuities) */
-      if (sym.id >= XK_Hstroke && sym.id <= XK_Hcircumflex)
-	lower->id += (XK_hstroke - XK_Hstroke);
-      else if (sym.id >= XK_Gbreve && sym.id <= XK_Jcircumflex)
-	lower->id += (XK_gbreve - XK_Gbreve);
-      else if (sym.id >= XK_hstroke && sym.id <= XK_hcircumflex)
-	upper->id -= (XK_hstroke - XK_Hstroke);
-      else if (sym.id >= XK_gbreve && sym.id <= XK_jcircumflex)
-	upper->id -= (XK_gbreve - XK_Gbreve);
-      else if (sym.id >= XK_Cabovedot && sym.id <= XK_Scircumflex)
-	lower->id += (XK_cabovedot - XK_Cabovedot);
-      else if (sym.id >= XK_cabovedot && sym.id <= XK_scircumflex)
-	upper->id -= (XK_cabovedot - XK_Cabovedot);
+      /* Assume the KeySym is a legal value (ignore discontinuities) */
+      if (sym >= XK_Hstroke && sym <= XK_Hcircumflex)
+	*lower += (XK_hstroke - XK_Hstroke);
+      else if (sym >= XK_Gbreve && sym <= XK_Jcircumflex)
+	*lower += (XK_gbreve - XK_Gbreve);
+      else if (sym >= XK_hstroke && sym <= XK_hcircumflex)
+	*upper -= (XK_hstroke - XK_Hstroke);
+      else if (sym >= XK_gbreve && sym <= XK_jcircumflex)
+	*upper -= (XK_gbreve - XK_Gbreve);
+      else if (sym >= XK_Cabovedot && sym <= XK_Scircumflex)
+	*lower += (XK_cabovedot - XK_Cabovedot);
+      else if (sym >= XK_cabovedot && sym <= XK_scircumflex)
+	*upper -= (XK_cabovedot - XK_Cabovedot);
       break;
     case 3: /* Latin 4 */
-      /* Assume the KeySym.Id is a legal value (ignore discontinuities) */
-      if (sym.id >= XK_Rcedilla && sym.id <= XK_Tslash)
-	lower->id += (XK_rcedilla - XK_Rcedilla);
-      else if (sym.id >= XK_rcedilla && sym.id <= XK_tslash)
-	upper->id -= (XK_rcedilla - XK_Rcedilla);
-      else if (sym.id == XK_ENG)
-	lower->id = XK_eng;
-      else if (sym.id == XK_eng)
-	upper->id = XK_ENG;
-      else if (sym.id >= XK_Amacron && sym.id <= XK_Umacron)
-	lower->id += (XK_amacron - XK_Amacron);
-      else if (sym.id >= XK_amacron && sym.id <= XK_umacron)
-	upper->id -= (XK_amacron - XK_Amacron);
+      /* Assume the KeySym is a legal value (ignore discontinuities) */
+      if (sym >= XK_Rcedilla && sym <= XK_Tslash)
+	*lower += (XK_rcedilla - XK_Rcedilla);
+      else if (sym >= XK_rcedilla && sym <= XK_tslash)
+	*upper -= (XK_rcedilla - XK_Rcedilla);
+      else if (sym == XK_ENG)
+	*lower = XK_eng;
+      else if (sym == XK_eng)
+	*upper = XK_ENG;
+      else if (sym >= XK_Amacron && sym <= XK_Umacron)
+	*lower += (XK_amacron - XK_Amacron);
+      else if (sym >= XK_amacron && sym <= XK_umacron)
+	*upper -= (XK_amacron - XK_Amacron);
       break;
     case 6: /* Cyrillic */
-      /* Assume the KeySym.Id is a legal value (ignore discontinuities) */
-      if (sym.id >= XK_Serbian_DJE && sym.id <= XK_Serbian_DZE)
-	lower->id -= (XK_Serbian_DJE - XK_Serbian_dje);
-      else if (sym.id >= XK_Serbian_dje && sym.id <= XK_Serbian_dze)
-	upper->id += (XK_Serbian_DJE - XK_Serbian_dje);
-      else if (sym.id >= XK_Cyrillic_YU && sym.id <= XK_Cyrillic_HARDSIGN)
-	lower->id -= (XK_Cyrillic_YU - XK_Cyrillic_yu);
-      else if (sym.id >= XK_Cyrillic_yu && sym.id <= XK_Cyrillic_hardsign)
-	upper->id += (XK_Cyrillic_YU - XK_Cyrillic_yu);
+      /* Assume the KeySym is a legal value (ignore discontinuities) */
+      if (sym >= XK_Serbian_DJE && sym <= XK_Serbian_DZE)
+	*lower -= (XK_Serbian_DJE - XK_Serbian_dje);
+      else if (sym >= XK_Serbian_dje && sym <= XK_Serbian_dze)
+	*upper += (XK_Serbian_DJE - XK_Serbian_dje);
+      else if (sym >= XK_Cyrillic_YU && sym <= XK_Cyrillic_HARDSIGN)
+	*lower -= (XK_Cyrillic_YU - XK_Cyrillic_yu);
+      else if (sym >= XK_Cyrillic_yu && sym <= XK_Cyrillic_hardsign)
+	*upper += (XK_Cyrillic_YU - XK_Cyrillic_yu);
       break;
     case 7: /* Greek */
-      /* Assume the KeySym.Id is a legal value (ignore discontinuities) */
-      if (sym.id >= XK_Greek_ALPHAaccent && sym.id <= XK_Greek_OMEGAaccent)
-	lower->id += (XK_Greek_alphaaccent - XK_Greek_ALPHAaccent);
-      else if (sym.id >= XK_Greek_alphaaccent && sym.id <= XK_Greek_omegaaccent &&
-	       sym.id != XK_Greek_iotaaccentdieresis &&
-	       sym.id != XK_Greek_upsilonaccentdieresis)
-	upper->id -= (XK_Greek_alphaaccent - XK_Greek_ALPHAaccent);
-      else if (sym.id >= XK_Greek_ALPHA && sym.id <= XK_Greek_OMEGA)
-	lower->id += (XK_Greek_alpha - XK_Greek_ALPHA);
-      else if (sym.id >= XK_Greek_alpha && sym.id <= XK_Greek_omega &&
-	       sym.id != XK_Greek_finalsmallsigma)
-	upper->id -= (XK_Greek_alpha - XK_Greek_ALPHA);
+      /* Assume the KeySym is a legal value (ignore discontinuities) */
+      if (sym >= XK_Greek_ALPHAaccent && sym <= XK_Greek_OMEGAaccent)
+	*lower += (XK_Greek_alphaaccent - XK_Greek_ALPHAaccent);
+      else if (sym >= XK_Greek_alphaaccent && sym <= XK_Greek_omegaaccent &&
+	       sym != XK_Greek_iotaaccentdieresis &&
+	       sym != XK_Greek_upsilonaccentdieresis)
+	*upper -= (XK_Greek_alphaaccent - XK_Greek_ALPHAaccent);
+      else if (sym >= XK_Greek_ALPHA && sym <= XK_Greek_OMEGA)
+	*lower += (XK_Greek_alpha - XK_Greek_ALPHA);
+      else if (sym >= XK_Greek_alpha && sym <= XK_Greek_omega &&
+	       sym != XK_Greek_finalsmallsigma)
+	*upper -= (XK_Greek_alpha - XK_Greek_ALPHA);
       break;
     case 0x14: /* Armenian */
-      if (sym.id >= XK_Armenian_AYB && sym.id <= XK_Armenian_fe) {
-	lower->id = sym.id | 1;
-	upper->id = sym.id & ~1;
+      if (sym >= XK_Armenian_AYB && sym <= XK_Armenian_fe) {
+	*lower = sym | 1;
+	*upper = sym & ~1;
       }
       break;
     }
diff --git a/property/prop.c b/property/prop.c
index ef8e6df..174c420 100644
--- a/property/prop.c
+++ b/property/prop.c
@@ -47,7 +47,7 @@ int property_changed(property_handlers_t
 	xcb_connection_t *c = get_xcb_connection(get_property_event_handlers(prophs));
 	node *cur;
 	for(cur = prophs->head; cur; cur = cur->next)
-		if(cur->name.xid == atom.xid)
+		if(cur->name == atom)
 			return call_handler(c, state, window, atom, &cur->h);
 	if(prophs->def)
 		return call_handler(c, state, window, atom, prophs->def);
diff --git a/renderutil/cache.c b/renderutil/cache.c
index 3bfeb87..96acbe8 100644
--- a/renderutil/cache.c
+++ b/renderutil/cache.c
@@ -115,9 +115,9 @@ has_required_depths (xcb_connection_t *c
 	 * associated visual.  Of course, the other depths still
 	 * work, but the only way to find out is to try them.
 	 */
-	if (pixmap.xid == -1)
-	    pixmap = xcb_pixmap_new(c);
-	root.window = screens.data->root;
+	if (pixmap == -1)
+	    pixmap = xcb_generate_id(c);
+	root = screens.data->root;
 	if (!pixmap_depths_usable (c, missing, pixmap, root))
 	    return 0;
     }
diff --git a/renderutil/util.c b/renderutil/util.c
index c405d0d..5cd6ac5 100644
--- a/renderutil/util.c
+++ b/renderutil/util.c
@@ -33,7 +33,7 @@ xcb_render_util_find_visual_format (cons
     for (screens = xcb_render_query_pict_formats_screens_iterator(formats); screens.rem; xcb_render_pictscreen_next(&screens))
 	for (depths = xcb_render_pictscreen_depths_iterator(screens.data); depths.rem; xcb_render_pictdepth_next(&depths))
 	    for (visuals = xcb_render_pictdepth_visuals_iterator(depths.data); visuals.rem; xcb_render_pictvisual_next(&visuals))
-		if (visuals.data->visual.id == visual.id)
+		if (visuals.data->visual == visual)
 		    return visuals.data;
     return 0;
 }
@@ -50,7 +50,7 @@ xcb_render_util_find_format (const xcb_r
     for (i = xcb_render_query_pict_formats_formats_iterator(formats); i.rem; xcb_render_pictforminfo_next(&i))
     {
 	if (mask & PictFormatID)
-	    if (template->id.xid != i.data->id.xid)
+	    if (template->id != i.data->id)
 		continue;
 	if (mask & PictFormatType)
 	    if (template->type != i.data->type)
@@ -83,7 +83,7 @@ xcb_render_util_find_format (const xcb_r
 	    if (template->direct.alpha_mask != i.data->direct.alpha_mask)
 		continue;
 	if (mask & PictFormatColormap)
-	    if (template->colormap.xid != i.data->colormap.xid)
+	    if (template->colormap != i.data->colormap)
 		continue;
 	if (count-- == 0)
 	    return i.data;
@@ -102,7 +102,7 @@ xcb_render_util_find_standard_format (co
 	/* PictStandardARGB32 */
 	{
 	    {
-		{ 0 },			    /* id */
+		0,			    /* id */
 		XCB_RENDER_PICT_TYPE_DIRECT,    /* type */
 		32,			    /* depth */
 		{ 0 },			    /* pad */
@@ -116,7 +116,7 @@ xcb_render_util_find_standard_format (co
 		    24,			    /* direct.alpha */
 		    0xff,		    /* direct.alphaMask */
 		},
-		{ 0 },			    /* colormap */
+		0,			    /* colormap */
 	    },
 	    PictFormatType | 
 	    PictFormatDepth |
@@ -132,7 +132,7 @@ xcb_render_util_find_standard_format (co
 	/* PictStandardRGB24 */
 	{
 	    {
-		{ 0 },			    /* id */
+		0,			    /* id */
 		XCB_RENDER_PICT_TYPE_DIRECT,    /* type */
 		24,			    /* depth */
 		{ 0 },			    /* pad */
@@ -146,7 +146,7 @@ xcb_render_util_find_standard_format (co
 		    0,			    /* direct.alpha */
 		    0x00,		    /* direct.alphaMask */
 		},
-		{ 0 },			    /* colormap */
+		0,			    /* colormap */
 	    },
 	    PictFormatType | 
 	    PictFormatDepth |
@@ -161,7 +161,7 @@ xcb_render_util_find_standard_format (co
 	/* PictStandardA8 */
 	{
 	    {
-		{ 0 },			    /* id */
+		0,			    /* id */
 		XCB_RENDER_PICT_TYPE_DIRECT,    /* type */
 		8,			    /* depth */
 		{ 0 },			    /* pad */
@@ -175,7 +175,7 @@ xcb_render_util_find_standard_format (co
 		    0,			    /* direct.alpha */
 		    0xff,		    /* direct.alphaMask */
 		},
-		{ 0 },			    /* colormap */
+		0,			    /* colormap */
 	    },
 	    PictFormatType | 
 	    PictFormatDepth |
@@ -188,7 +188,7 @@ xcb_render_util_find_standard_format (co
 	/* PictStandardA4 */
 	{
 	    {
-		{ 0 },			    /* id */
+		0,			    /* id */
 		XCB_RENDER_PICT_TYPE_DIRECT,    /* type */
 		4,			    /* depth */
 		{ 0 },			    /* pad */
@@ -202,7 +202,7 @@ xcb_render_util_find_standard_format (co
 		    0,			    /* direct.alpha */
 		    0x0f,		    /* direct.alphaMask */
 		},
-		{ 0 },			    /* colormap */
+		0,			    /* colormap */
 	    },
 	    PictFormatType | 
 	    PictFormatDepth |
@@ -215,7 +215,7 @@ xcb_render_util_find_standard_format (co
 	/* PictStandardA1 */
 	{
 	    {
-		{ 0 },			    /* id */
+		0,			    /* id */
 		XCB_RENDER_PICT_TYPE_DIRECT,    /* type */
 		1,			    /* depth */
 		{ 0 },			    /* pad */
@@ -229,7 +229,7 @@ xcb_render_util_find_standard_format (co
 		    0,			    /* direct.alpha */
 		    0x01,		    /* direct.alphaMask */
 		},
-		{ 0 },			    /* colormap */
+		0,			    /* colormap */
 	    },
 	    PictFormatType | 
 	    PictFormatDepth |
diff --git a/wm/manage.c b/wm/manage.c
index 7b69983..405d377 100644
--- a/wm/manage.c
+++ b/wm/manage.c
@@ -18,22 +18,22 @@ void manageWindow(property_handlers_t *p
 			return;
 		if(attr->map_state != XCB_MAP_STATE_VIEWABLE)
 		{
-			printf("Window 0x%08x is not mapped. Ignoring.\n", window.xid);
+			printf("Window 0x%08x is not mapped. Ignoring.\n", window);
 			free(attr);
 			return;
 		}
 		wa.tag = TAG_VALUE;
 		wa.u.override_redirect = attr->override_redirect;
 	}
-	if(!wa.u.override_redirect && TableGet(byChild, window.xid))
+	if(!wa.u.override_redirect && TableGet(byChild, window))
 	{
-		printf("Window 0x%08x already managed. Ignoring.\n", window.xid);
+		printf("Window 0x%08x already managed. Ignoring.\n", window);
 		free(attr);
 		return;
 	}
 	if(wa.u.override_redirect)
 	{
-		printf("Window 0x%08x has override-redirect set. Ignoring.\n", window.xid);
+		printf("Window 0x%08x has override-redirect set. Ignoring.\n", window);
 		free(attr);
 		return;
 	}
@@ -58,16 +58,16 @@ int handleMapNotifyEvent(void *prophs, x
 {
 	WindowAttributes wa = { TAG_VALUE };
 	wa.u.override_redirect = e->override_redirect;
-	printf("MapNotify for 0x%08x.\n", e->window.xid);
+	printf("MapNotify for 0x%08x.\n", e->window);
 	manageWindow(prophs, c, e->window, wa);
 	return 1;
 }
 
 int handleUnmapNotifyEvent(void *data, xcb_connection_t *c, xcb_unmap_notify_event_t *e)
 {
-	ClientWindow *client = TableRemove(byChild, e->event.xid);
+	ClientWindow *client = TableRemove(byChild, e->event);
 	xcb_window_t root;
-	printf("UnmapNotify for 0x%08x (received from 0x%08x): ", e->window.xid, e->event.xid);
+	printf("UnmapNotify for 0x%08x (received from 0x%08x): ", e->window, e->event);
 	if(!client)
 	{
 		printf("not a managed window. Ignoring.\n");
@@ -75,11 +75,11 @@ int handleUnmapNotifyEvent(void *data, x
 	}
 
 	root = xcb_setup_roots_iterator(xcb_get_setup(c)).data->root;
-	printf("child of 0x%08x.\n", client->parent.xid);
+	printf("child of 0x%08x.\n", client->parent);
 	xcb_reparent_window(c, client->child, root, 0, 0);
 	xcb_destroy_window(c, client->parent);
 	xcb_flush(c);
-	TableRemove(byParent, client->parent.xid);
+	TableRemove(byParent, client->parent);
 	free(client);
 	return 1;
 }
diff --git a/wm/reply_formats.c b/wm/reply_formats.c
index d48c9fb..736f47a 100644
--- a/wm/reply_formats.c
+++ b/wm/reply_formats.c
@@ -14,7 +14,7 @@ int formatGetWindowAttributesReply(xcb_w
     if(!reply)
     {
         fprintf(stderr, "Failed to get attributes for window " WINFMT ".\n",
-            (unsigned int) wid.xid);
+            (unsigned int) wid);
         return 0;
     }
 
@@ -34,9 +34,9 @@ int formatGetWindowAttributesReply(xcb_w
            "    allEventMasks      = 0x%08x\n"
            "    yourEventMask      = 0x%08x\n"
            "    doNotPropagateMask = 0x%08x\n",
-        (unsigned int) wid.xid,
+        (unsigned int) wid,
         reply->backing_store,
-        (unsigned int) reply->visual.id,
+        (unsigned int) reply->visual,
         reply->_class,
         reply->bit_gravity,
         reply->win_gravity,
@@ -46,7 +46,7 @@ int formatGetWindowAttributesReply(xcb_w
         reply->map_is_installed,
         reply->map_state,
         reply->override_redirect,
-        (unsigned int) reply->colormap.xid,
+        (unsigned int) reply->colormap,
         (unsigned int) reply->all_event_masks,
         (unsigned int) reply->your_event_mask,
         reply->do_not_propagate_mask);
@@ -60,12 +60,12 @@ int formatGetGeometryReply(xcb_window_t 
     if(!reply)
     {
         fprintf(stderr, "Failed to get geometry for window " WINFMT ".\n",
-            (unsigned int) wid.xid);
+            (unsigned int) wid);
         return 0;
     }
 
     printf("Geometry for window " WINFMT ": %dx%d%+d%+d\n",
-        (unsigned int) wid.xid,
+        (unsigned int) wid,
         reply->width,
         reply->height,
         reply->x,
@@ -82,20 +82,20 @@ int formatQueryTreeReply(xcb_window_t wi
     if(!reply)
     {
         fprintf(stderr, "Failed to query tree for window " WINFMT ".\n",
-            (unsigned int) wid.xid);
+            (unsigned int) wid);
         return 0;
     }
 
     printf("Window " WINFMT " has parent " WINFMT ", root " WINFMT ", and %d children%c\n",
-        (unsigned int) wid.xid,
-        (unsigned int) reply->parent.xid,
-        (unsigned int) reply->root.xid,
+        (unsigned int) wid,
+        (unsigned int) reply->parent,
+        (unsigned int) reply->root,
         (unsigned int) reply->children_len,
         reply->children_len ? ':' : '.');
 
     for(i = 0; i < reply->children_len; ++i)
         printf("    window " WINFMT "\n",
-            (unsigned int) xcb_query_tree_children(reply)[i].xid);
+            (unsigned int) xcb_query_tree_children(reply)[i]);
 
     fflush(stdout);
     return 1;
diff --git a/wm/xcbwm-test.c b/wm/xcbwm-test.c
index 79ed531..3b04a44 100644
--- a/wm/xcbwm-test.c
+++ b/wm/xcbwm-test.c
@@ -67,8 +67,8 @@ static int addClientWindow(xcb_window_t 
 	record->name_len = 0;
 	record->name = 0;
 	record->titlegc = titlegc;
-	success = TablePut(byParent, parent.xid, record) &&
-		TablePut(byChild, child.xid, record);
+	success = TablePut(byParent, parent, record) &&
+		TablePut(byChild, child, record);
 	assert(success);
 	return 1;
 }
@@ -84,7 +84,7 @@ void reparentWindow(xcb_connection_t *c,
 	xcb_screen_t *root = xcb_setup_roots_iterator(xcb_get_setup(c)).data;
 	xcb_gcontext_t titlegc;
 
-	w = xcb_window_new(c);
+	w = xcb_generate_id(c);
 
 	mask |= XCB_CW_BACK_PIXEL;
 	values[0] = root->white_pixel;
@@ -96,19 +96,19 @@ void reparentWindow(xcb_connection_t *c,
 	values[2] = XCB_EVENT_MASK_BUTTON_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE
 		| XCB_EVENT_MASK_EXPOSURE /* | XCB_EVENT_MASK_ENTER_WINDOW | XCB_EVENT_MASK_LEAVE_WINDOW */;
 
-	printf("Reparenting 0x%08x under 0x%08x.\n", child.xid, w.xid);
+	printf("Reparenting 0x%08x under 0x%08x.\n", child, w);
 	xcb_create_window(c, d, w, r, x, y,
 			width + LEFT + RIGHT, height + TOP + BOTTOM,
 			/* border_width */ 0, XCB_WINDOW_CLASS_INPUT_OUTPUT, v, mask, values);
 	xcb_change_save_set(c, XCB_SET_MODE_INSERT, child);
 	xcb_map_window(c, w);
 
-	titlegc = xcb_gcontext_new(c);
+	titlegc = xcb_generate_id(c);
 
 	mask = XCB_GC_FOREGROUND | XCB_GC_BACKGROUND;
 	values[0] = root->black_pixel;
 	values[1] = root->white_pixel;
-	drawable.window = w;
+	drawable = w;
 	xcb_create_gc(c, titlegc, drawable, mask, values);
 	addClientWindow(child, w, titlegc);
 
@@ -126,7 +126,7 @@ static void redrawWindow(xcb_connection_
 	xcb_drawable_t d = { client->parent };
 	if(!client->name_len)
 		return;
-	xcb_clear_area(c, 0, d.window, 0, 0, 0, 0);
+	xcb_clear_area(c, 0, d, 0, 0, 0, 0);
 	xcb_image_text_8(c, client->name_len, d, client->titlegc,
 			LEFT - 1, TOP - 4, client->name);
 	xcb_flush(c);
@@ -134,7 +134,7 @@ static void redrawWindow(xcb_connection_
 
 static int handleExposeEvent(void *data, xcb_connection_t *c, xcb_expose_event_t *e)
 {
-	ClientWindow *client = TableGet(byParent, e->window.xid);
+	ClientWindow *client = TableGet(byParent, e->window);
 	if(!client || e->count != 0)
 		return 1;
 	redrawWindow(c, client);
@@ -143,8 +143,8 @@ static int handleExposeEvent(void *data,
 
 static int handleWMNameChange(void *data, xcb_connection_t *c, uint8_t state, xcb_window_t window, xcb_atom_t atom, xcb_get_property_reply_t *prop)
 {
-	ClientWindow *client = TableGet(byChild, window.xid);
-	printf("WM_NAME change: Window 0x%08x ", window.xid);
+	ClientWindow *client = TableGet(byChild, window);
+	printf("WM_NAME change: Window 0x%08x ", window);
 	if(!client)
 	{
 		printf("is not being managed.\n");


More information about the xcb-commit mailing list