This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author GabeMillikan
Recipients GabeMillikan, epaine, serhiy.storchaka, terry.reedy
Date 2021-11-01.16:40:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1635784807.42.0.643109504408.issue45681@roundup.psfhosted.org>
In-reply-to
Content
The exact same effect happens with SetProcessDPIAware(1). The IDLE checkboxes are in fact affected; they're tiny. I discovered that I was able to prevent the issue by using `ctypes.windll.shcore.SetProcessDpiAwareness(0)`. This prevents the issue only if it is called prior to the SetProcessDPIAware call.

This code does not have any issues (everything is correctly scaled)

```
import tkinter as tk
from tkinter import ttk

import ctypes
ctypes.windll.shcore.SetProcessDpiAwareness(0)
ctypes.windll.user32.SetProcessDPIAware()

w = tk.Tk()
ttk.Checkbutton(w, text = "Checkbox").grid()
w.mainloop()
```

If the SetProcessDpiAwareness call comes after the SetProcessDPIAware call, then the error persists. I believe that this is because Windows only listens to the first DPI configuration call, so it ignores subsequent calls. I was unable to find documentation to support this though.
History
Date User Action Args
2021-11-01 16:40:07GabeMillikansetrecipients: + GabeMillikan, terry.reedy, serhiy.storchaka, epaine
2021-11-01 16:40:07GabeMillikansetmessageid: <1635784807.42.0.643109504408.issue45681@roundup.psfhosted.org>
2021-11-01 16:40:07GabeMillikanlinkissue45681 messages
2021-11-01 16:40:07GabeMillikancreate