GNOME Bugzilla – Bug 687792
Gdk.Screen().get_display() throws segmentation fault
Last modified: 2012-11-07 08:01:36 UTC
The following snippet in PyGTK works: <code> from gtk.gdk import Screen Screen().get_display() </code> However, it doesn't work for PyGObject <code> from gi.repository.Gdk import Screen Screen().get_display() </code> It ends up in a Segmentation fault. Reproduced on 3.4.0-1 on Ubuntu 12.10.
Right, don't try to instantiate a fresh Gdk.Screen object with the GObject constructor. There is no public constructor, just the get_default() factory method (and perhaps some other API which returns Screen objects): $ python3 -c 'from gi.repository.Gdk import Screen; print(Screen.get_default().get_display())' <gtk.gdk.X11Display object at 0x7f5d9a4c5910 (GdkX11Display at 0x2a330b0)> This is a segfault in Gdk itself. *** This bug has been marked as a duplicate of bug 675581 ***