title: How to get Gdk window from xid?
body: <p>I'm lost in version 3.. in python2+gdk2 is:
  </p>
  
  <pre><code>#!/usr/bin/env python2
  import gtk
  
  gtk.gdk.window_process_all_updates()
  window_xid = 54525964
  gdk_window = gtk.gdk.window_foreign_new(window_xid)
  </code></pre>
  
  <p>which is pretty much straight forward. But then, the horror:
  </p>
  
  <pre><code>#!/usr/bin/env python3
  from gi.repository import xlib
  from gi.repository import Gdk
  from gi.repository import GdkX11
  
  Gdk.Window.process_all_updates()
  xlib_window = "???????"
  gdk_display = GdkX11.X11Display.get_default()
  gdk_window = GdkX11.X11Window.foreign_new_for_display(gdk_display, xlib_window)
  </code></pre>
  
  <p>the xlib is killing me.. I'm unable to do anything with it. Has anybody worked with it before??</p>
  
  <p>The documentation I've through several times already is:
  <a href="http://developer.gnome.org/gdk3/3.0/gdk3-X-Window-System-Interaction.html#gdk-x11-window-foreign-new-for-display" rel="noreferrer">Gdk3</a>,
  <a href="http://tronche.com/gui/x/xlib/" rel="noreferrer">Xlib</a></p>
  
  <p>Getting the window from its xid was the fastest way to get a screenshot in python2 I guess I'll have try another way in python3.. any ideas? maybe peek_children from root window?? but then, how do I know if it's the window I want?</p>