Repository navigation
Fix app icon bug on Windows when running IPython - #32360
Merged
Merged
Conversation
ayshih
marked this pull request as draft
September 17, 2026 14:28
ayshih
marked this pull request as ready for review
September 17, 2026 15:54
iccir
reviewed
Sep 17, 2026
iccir
approved these changes
Sep 17, 2026
QuLogic
approved these changes
Sep 24, 2026
QuLogic
left a comment
Member
There was a problem hiding this comment.
I trust you that this fixes things. It doesn't seem strange otherwise.
|
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. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
iccir
pushed a commit
that referenced
this pull request
Sep 25, 2026
(cherry picked from commit 620348a)
iccir
added a commit
that referenced
this pull request
Sep 25, 2026
Backport PR #32360 on branch v3.11.x (Fix app icon bug on Windows when running IPython)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR summary
When running IPython on Windows and using one of the Tk backends, the app icon for a new matplotlib window can incorrectly be the default Tk icon instead of the matplotlib icon. Apparently the IPython event loop suppresses the Tk event loop in such a manner that the setting of the app icon may not go through if Tk has not been used for a while in the IPython session.
To see the bug, run the following on Windows in an interactive IPython session:
This PR explicitly calls(calling.update()right after setting the icon to ensure that the icon change is actually processed.update()is discouraged, xref #17789)This PR moves the icon-setting code to right after the new window is shown for the first time, and the bug stops happening.
AI Disclosure
No AI was used
PR quality check