From 91208d8eb9390764d19b7bede720cc9ab8fddbd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Stadler?= Date: Tue, 27 Nov 2007 17:11:28 +0200 Subject: [PATCH] Add fuzzy compatibility to unpatched pygtk 2.12.0 --- debug-viewer/GstDebugViewer/Plugins/Timeline.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/debug-viewer/GstDebugViewer/Plugins/Timeline.py b/debug-viewer/GstDebugViewer/Plugins/Timeline.py index d45a883488..373147a80c 100644 --- a/debug-viewer/GstDebugViewer/Plugins/Timeline.py +++ b/debug-viewer/GstDebugViewer/Plugins/Timeline.py @@ -720,10 +720,20 @@ class TimelineFeature (FeatureBase): return column = self.log_view.get_column (0) - cell_rect = self.log_view.get_cell_area (start_path, column) - first_y = self.log_view.convert_bin_window_to_widget_coords (cell_rect.x, cell_rect.y)[1] bg_rect = self.log_view.get_background_area (start_path, column) cell_height = bg_rect.height + cell_rect = self.log_view.get_cell_area (start_path, column) + try: + first_y = self.log_view.convert_bin_window_to_widget_coords (cell_rect.x, cell_rect.y)[1] + except (AttributeError, SystemError,): + # AttributeError is with PyGTK before 2.12. SystemError is raised + # with PyGTK 2.12.0, pygtk bug #479012. + first_y = cell_rect.y % cell_height + if not hasattr (self, "_warn_tree_view_coords"): + self.logger.warning ("tree view coordinate conversion method " + "not available, using aproximate offset") + # Only warn once: + self._warn_tree_view_coords = True data = [] tree_iter = model.get_iter (start_path)