diff --git a/MyTimeline.py b/MyTimeline.py index f980871..a55fb5f 100644 --- a/MyTimeline.py +++ b/MyTimeline.py @@ -2606,7 +2606,13 @@ class MyTimelineView(NavigationView): # Cancel existing tooltip timeout if self.tooltip_timeout_id: - GLib.source_remove(self.tooltip_timeout_id) + # source_remove returns True if successful, False if source not found + # Suppress the warning by checking return value (but warning may still occur) + try: + removed = GLib.source_remove(self.tooltip_timeout_id) + except (AttributeError, TypeError): + # Source ID is invalid, ignore + removed = False self.tooltip_timeout_id = None # Hide existing tooltip @@ -2639,7 +2645,13 @@ class MyTimelineView(NavigationView): # Cancel tooltip timeout if self.tooltip_timeout_id: - GLib.source_remove(self.tooltip_timeout_id) + # source_remove returns True if successful, False if source not found + # Suppress the warning by checking return value (but warning may still occur) + try: + removed = GLib.source_remove(self.tooltip_timeout_id) + except (AttributeError, TypeError): + # Source ID is invalid, ignore + removed = False self.tooltip_timeout_id = None # Hide tooltip