-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
gh-119459: Fix HiDPI blurring of every program window that using tkinter #119902
base: main
Are you sure you want to change the base?
Conversation
# CALL BEFORE ANY TK OPERATIONS! | ||
# URL for arguments for the ...Awareness call below. | ||
# https://msdn.microsoft.com/en-us/library/windows/desktop/dn280512(v=vs.85).aspx | ||
if sys.platform == 'win32': |
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.
In my humble opinion, can you guarantee that this code will not be called repeatedly? Maybe it only needs to be called once?
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.
Add a print
statement to your code and just try the code below:
from tkinter import messagebox
messagebox.showinfo("info", "test")
messagebox.showinfo("info", "test")
Then you'll find that it runs twice.
Refer #119459 , we believe this is a tk/tkinter bug that should be fixed in tkinter. In this PR, I added the fix code to
tkinter/__init__.py
, which fixes the window blurring problem that every program that uses tkinter has. Since I had already committed fix for turtledemo and terryjreedy fix IDLE earlier, I removed them here. Also #119175 was backported to 3.12 3.13 and I think this PR should be as well.↓Fix