42 lines
1.4 KiB
Diff
42 lines
1.4 KiB
Diff
From 7a3bb6971f22accd25e987496d377e1879f6e1ba Mon Sep 17 00:00:00 2001
|
|
From: Christoph Reiter <creiter@src.gnome.org>
|
|
Date: Sat, 30 May 2015 17:46:54 +0200
|
|
Subject: [PATCH] Remove Gdk.Rectangle alias with newer gobject-introspection
|
|
and GTK+
|
|
|
|
The new GdkRectangle in the typelib confuses the marshalling code
|
|
as PyGObject uses the Python class from the overrides for marshalling
|
|
to Python but uses the gtype from the typelib to do
|
|
type checking when marshalling from Python.
|
|
|
|
https://bugzilla.gnome.org/show_bug.cgi?id=749625
|
|
---
|
|
gi/overrides/Gdk.py | 10 +++++++---
|
|
1 file changed, 7 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/gi/overrides/Gdk.py b/gi/overrides/Gdk.py
|
|
index 15f2a0a..3ab5d6d 100644
|
|
--- a/gi/overrides/Gdk.py
|
|
+++ b/gi/overrides/Gdk.py
|
|
@@ -126,10 +126,14 @@ if Gdk._version == '2.0':
|
|
Rectangle = override(Rectangle)
|
|
__all__.append('Rectangle')
|
|
else:
|
|
- from gi.repository import cairo as _cairo
|
|
- Rectangle = _cairo.RectangleInt
|
|
+ # Newer GTK+/gobject-introspection (3.17.x) include GdkRectangle in the
|
|
+ # typelib. See https://bugzilla.gnome.org/show_bug.cgi?id=748832 and
|
|
+ # https://bugzilla.gnome.org/show_bug.cgi?id=748833
|
|
+ if not hasattr(Gdk, 'Rectangle'):
|
|
+ from gi.repository import cairo as _cairo
|
|
+ Rectangle = _cairo.RectangleInt
|
|
|
|
- __all__.append('Rectangle')
|
|
+ __all__.append('Rectangle')
|
|
|
|
if Gdk._version == '2.0':
|
|
class Drawable(Gdk.Drawable):
|
|
--
|
|
2.4.2
|
|
|