Thanks to visit codestin.com
Credit goes to github.com

Skip to content

FIX: Add version gate to GTK4 calls when necessary #29363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

greglucas
Copy link
Contributor

PR summary

get_current_event() calls within pygobject would cause segfaults. This was fixed in 3.47, so gate the guiEvent information to only access that method in versions that don't segfault.

closes #29350

PR checklist

@greglucas greglucas added this to the v3.10.1 milestone Dec 20, 2024
@tacaswell tacaswell added the Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. label Dec 20, 2024
@@ -37,6 +39,7 @@ class FigureCanvasGTK4(_FigureCanvasGTK, Gtk.DrawingArea):

def __init__(self, figure=None):
super().__init__(figure=figure)
print("GI version", gi.version_info)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print("GI version", gi.version_info)

stray debugging print.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I guess this confirms I was testing it locally with various gi versions ;) and this did work on both lower and upper

get_current_event() calls within pygobject would cause segfaults. This
was fixed in 3.47, so gate the guiEvent information to only access
that method in versions that don't segfault.
Copy link
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mypy failure is unrelated (#29362)

@tacaswell tacaswell closed this Jan 6, 2025
@tacaswell tacaswell reopened this Jan 6, 2025
@tacaswell
Copy link
Member

"power-cycled" to re-run against current main which should fix the mypy issues.

@greglucas greglucas merged commit cb2d928 into matplotlib:main Jan 6, 2025
61 of 63 checks passed
@greglucas greglucas deleted the gtk4-guievent branch January 6, 2025 16:12
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Jan 6, 2025
rcomer added a commit that referenced this pull request Jan 6, 2025
…363-on-v3.10.x

Backport PR #29363 on branch v3.10.x (FIX: Add version gate to GTK4 calls when necessary)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI: gtk Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Matplotlib causes segmentation fault when hovering mouse over graph
3 participants