summaryrefslogtreecommitdiff
path: root/pygtkcompat
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2019-02-16 17:02:35 +0100
committerChristoph Reiter <reiter.christoph@gmail.com>2019-02-16 17:20:34 +0100
commit7e6e5ae1cb587576774130a1b256b497665b9c9a (patch)
treec3ba2b663cfea6ce5b591d32c9010edb680fda9a /pygtkcompat
parent2beb49cf2501063d9f19bc86ba4c0a688808612d (diff)
downloadpygobject-7e6e5ae1cb587576774130a1b256b497665b9c9a.tar.gz
tests: more pygtkcompat coverage
Diffstat (limited to 'pygtkcompat')
-rw-r--r--pygtkcompat/pygtkcompat.py24
1 files changed, 2 insertions, 22 deletions
diff --git a/pygtkcompat/pygtkcompat.py b/pygtkcompat/pygtkcompat.py
index 85eb35b2..c9711c68 100644
--- a/pygtkcompat/pygtkcompat.py
+++ b/pygtkcompat/pygtkcompat.py
@@ -199,10 +199,7 @@ def enable_gtk(version='3.0'):
_patch(Gdk, "PixbufLoader", GdkPixbuf.PixbufLoader.new_with_type)
_patch(Gdk, "pixbuf_new_from_data", GdkPixbuf.Pixbuf.new_from_data)
_patch(Gdk, "pixbuf_new_from_file", GdkPixbuf.Pixbuf.new_from_file)
- try:
- _patch(Gdk, "pixbuf_new_from_file_at_scale", GdkPixbuf.Pixbuf.new_from_file_at_scale)
- except AttributeError:
- pass
+ _patch(Gdk, "pixbuf_new_from_file_at_scale", GdkPixbuf.Pixbuf.new_from_file_at_scale)
_patch(Gdk, "pixbuf_new_from_file_at_size", GdkPixbuf.Pixbuf.new_from_file_at_size)
_patch(Gdk, "pixbuf_new_from_inline", GdkPixbuf.Pixbuf.new_from_inline)
_patch(Gdk, "pixbuf_new_from_stream", GdkPixbuf.Pixbuf.new_from_stream)
@@ -230,20 +227,6 @@ def enable_gtk(version='3.0'):
_patch(Gdk, "pixbuf_get_formats", get_formats)
- orig_get_frame_extents = Gdk.Window.get_frame_extents
-
- def get_frame_extents(window):
- try:
- try:
- rect = Gdk.Rectangle(0, 0, 0, 0)
- except TypeError:
- rect = Gdk.Rectangle()
- orig_get_frame_extents(window, rect)
- except TypeError:
- rect = orig_get_frame_extents(window)
- return rect
- _patch(Gdk.Window, "get_frame_extents", get_frame_extents)
-
orig_get_origin = Gdk.Window.get_origin
def get_origin(self):
@@ -412,10 +395,7 @@ def enable_gtk(version='3.0'):
_patch(Gtk, "image_new_from_file", Gtk.Image.new_from_file)
_patch(Gtk, "settings_get_default", Gtk.Settings.get_default)
_patch(Gtk, "window_set_default_icon", Gtk.Window.set_default_icon)
- try:
- _patch(Gtk, "clipboard_get", Gtk.Clipboard.get)
- except AttributeError:
- pass
+ _patch(Gtk, "clipboard_get", Gtk.Clipboard.get)
# AccelGroup
_patch(Gtk.AccelGroup, "connect_group", Gtk.AccelGroup.connect)