After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 698005 - GdkX11Window oddities
GdkX11Window oddities
Status: RESOLVED WONTFIX
Product: pygobject
Classification: Bindings
Component: general
3.8.x
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on: 656314
Blocks:
 
 
Reported: 2013-04-14 15:16 UTC by Christoph Reiter (lazka)
Modified: 2014-08-31 00:31 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Christoph Reiter (lazka) 2013-04-14 15:16:16 UTC
This confused me during porting PyGTK code:

>>> from gi.repository import Gtk
>>> w = Gtk.Window()
>>> w.show()
>>> w.get_window()
<gtk.gdk.X11Window object at 0x1115e10 (GdkX11Window at 0x118f360)>
>>> w.get_window().get_xid()
Traceback (most recent call last):
  • File "<stdin>", line 1 in <module>
AttributeError: 'gtk.gdk.X11Window' object has no attribute 'get_xid'

>>> from gi.repository import Gtk, GdkX11
>>> w = Gtk.Window()
>>> w.show()
>>> w.get_window()
<X11Window object at 0x223bf50 (GdkX11Window at 0x22b5360)>
>>> w.get_window().get_xid()
69206019L

It seems one has to import GdkX11 before calling get_window() to get a fully functional subclass (also the __name__ of the first returned type looks a bit like PyGTK..).

I don't know how this all works, but it would be nice if the Gdk overrides would try to import GdkX11.
Comment 1 Simon Feltman 2013-04-15 12:59:27 UTC

*** This bug has been marked as a duplicate of bug 656314 ***
Comment 2 Simon Feltman 2014-08-31 00:31:56 UTC
Un-marking as dup because while bug 656314 is essentially the same, fixing it won't resolve all problems in this specific case. An additional issue is we would need the Gdk gir/typelib to include GdkX11 which probably won't happen due to needing backend portability. If you feel this is wrong, feel free to re-open and move the ticket to GTK+.