title: How to properly configure windows using xcb ConfigureWindow in python
body: <p>I am working on an X11 window manager, writing it in python. I am encountering a problem, where I get, and handle ConfigureWindowEvents. But, even then, when a window is mapped, it shows up as a two pixel high, one pixel wide window. I have put together the following example code so that others may test it, and tell me if I am doing this wrong. I based my ConfigureEvent handling code on qtile's</p>
  
  <pre><code>import xcb
  import xcb.xproto as xproto
  from xcb.xproto import ConfigWindow as cw
  
  conn = xcb.connect()
  root = conn.get_setup().roots[0].root
  eventmask = [xproto.EventMask.SubstructureRedirect]
  err =conn.core.ChangeWindowAttributesChecked(root, xproto.CW.EventMask, eventmask)
  check = err.check()
  if check:
      print check
  
  while True:
      e = conn.wait_for_event()
  
      if isinstance(e, xproto.MapRequestEvent):
          conn.core.MapWindow(e.window)
  
      if isinstance(e, xproto.ConfigureRequestEvent):
          y = x = w = h = bw = 0
          if e.value_mask &amp; cw.X:
              x = e.x
              print "x:", x
          if e.value_mask &amp; cw.Y:
              y = e.y
              print "y:", y
          if e.value_mask &amp; cw.Height:
              h = e.height
              print "h:", h
          if e.value_mask &amp; cw.Width:
              w = e.width
              print 'w:', w
          if e.value_mask &amp; cw.BorderWidth:
              bw = e.border_width
              print 'bw:', bw
          mask = cw.X | cw.Y |  cw.Width | cw.Height | cw.BorderWidth
          values = {cw.X: x, cw.Y: y, cw.Width:  w, cw.Height: h, cw.BorderWidth: bw}
          err = conn.core.ConfigureWindowChecked(e.window, mask, values)
          err.check()
      conn.flush()
      print e
  </code></pre>
  
  <p>I'm using the Checked functions in hope of catching errors</p>