-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
tk/wx: Fix saving after the window is closed #17391
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems reasonable; conditional on ci
plt.show() | ||
|
||
# Ensure that the window is really closed. | ||
plt.pause(0.5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, if anyone can think of a better way to do this, I'd change it.
I tried fig.canvas.flush_events()
, but that crashes because the main window is gone. If you ignore any crashes, then the test doesn't fail like it should on master
.
The test shows that that wx is also broken the same way. The Qt backend is also failing, but a little differently and might be a reproducibility thing. |
Partially fixed wx, but I guess the failure on other Python versions is a little different. Don't know what's up with Qt on macOS. |
wx is fixed, but Qt is broken on macOS, as the figure appears to resize incorrectly, being 469 pixels after opening the window instead of 480 before. |
This is really optional, and fails in `Figure.savefig` if `plt.show()` is called before it.
We've had a report with Tk, and I think with WebAgg previously, so at least do a simple test that it works.
We don't need to run `gui_repaint` if the window is gone, so just skip it.
In classic wx, there were multiple functions for overloaded C++ methods, but in phoenix there's just the one.
It's currently failing because of incorrect resizing when the window is opened. matplotlib#7472
I decided to skip the equality check on Qt5+macOS, as I can't debug this myself, we have an open issue for it, and this PR is really about fixing saving itself (which is fine on that backend/OS). |
Restarted the stalled CI, anyone can merge on green. |
It seems like it might be stuck, but I don't know where. I've pushed a commit to debug this. |
well, the OSX jobs passed now, but the linux ones seem to be having infrastructure issues. |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon! If these instruction are inaccurate, feel free to suggest an improvement. |
…3.2.x Backport PR #17391 on branch v3.2.x
PR Summary
Fixes #16909.
Fixes #17388.
PR Checklist