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.

Title: Tk DPI awareness
Type: enhancement Stage: resolved
Components: Tkinter, Windows Versions: Python 3.6
Status: closed Resolution: duplicate
Dependencies: Superseder: IDLE: Turn on DPI awareness on Windows
View: 33656
Assigned To: Nosy List: eric.fahlgren, eryksun, gpolo, paul.moore, serhiy.storchaka, steve.dower, terry.reedy, tim.golden, westley.martinez, wordtech, zach.ware
Priority: normal Keywords:

Created on 2016-04-06 02:53 by westley.martinez, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (9)
msg262930 - (view) Author: Westley Martínez (westley.martinez) * Date: 2016-04-06 02:53
IDLE is blurry on High DPI Windows, because IDLE is not DPI aware. IDLE should be made to be DPI aware so that the text is more readable.
msg262996 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2016-04-07 16:45
This is not an IDLE issue, and probably not a tkinter issue.  The display of characters on a screen is done by the OS font software under direction of tcl/tk.

What OS are you running and what version of Tk (see IDLE -> Help -> About IDLE)?
msg264128 - (view) Author: Westley Martínez (westley.martinez) * Date: 2016-04-24 20:26
IDLE 3.5.1 on Windows 10
msg319120 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-06-08 23:57
Westly, #31500 changed font scaling for IDLE on high DPI screens.  It also removed some hard-coding of frame sizes in terms of pixels.  Does anything look better for you with current IDLE (3.6.5, 3.7.0)?
msg319123 - (view) Author: Eric Fahlgren (eric.fahlgren) * Date: 2018-06-09 01:19
Still blurry with 3.6.5 on Win 10 with a 2560x1600 monitor at 125% scaling (I compared it to 2.7.15, they looked identical).  If I go to the Windows properties for pythonw.exe and turn on "Override high DPI scaling behavior" it's nice and sharp.
msg319132 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-06-09 03:07
Do any of the Windows experts know what "Override high DPI scaling behavior" on properties does?  Does it call SetProcessDpiAwareness?  It seems so. The answer would have implications for #33656 (which is about fixing this issue in IDLE, as Westly originally requested here).

This setting is on the popup when one clicks [Change high DPI settings] on the Compatibility tab.  Eric, there is a dropdown with 3 possible overrides.  Application (default), System, System [Enhanced].  Which one did you use?

In my experiments, 'Application has the same effect as SetProcessDpiAwareness(1), while 'System' is the same as SetProcessDpiAwareness(0).  I expected this from what I posted on #33656.

Since the properties settings may or not be correct for all graphics packages, but will likely be correct for all tk and tkinter apps, I think tkinter should perhaps be modified.  The question is whether SetProcessDpiAwareness(1) is correct (for tk and tkinter) for all monitors.  I suspect so but don't know for sure.
msg319133 - (view) Author: Eric Fahlgren (eric.fahlgren) * Date: 2018-06-09 03:28
I used the default Application setting.
msg319147 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-06-09 15:13
Elisha Paine, who prompted #33656 by posting the SetProcessDpiAwareness(1) fix to the idledev list, wrote to me that pyglet and probably pygame have similar issues.

I wonder if Python should be installed with the 'application' setting, or if DPI adjustment should be discussed in the Windows section of the Using manual.
msg319423 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-06-13 04:12
The fix for IDLE on Windows made it into 3.6.6rc1 and 3.7.0rc1.

Changing the python.exe and pythonw.exe default dpi settings is a possible issue for 3.8, and should have Steve.Dower nosy.
Date User Action Args
2022-04-11 14:58:29adminsetgithub: 70885
2018-06-13 04:12:13terry.reedysetstatus: open -> closed
superseder: IDLE: Turn on DPI awareness on Windows
messages: + msg319423

resolution: duplicate
stage: resolved
2018-06-09 15:13:39terry.reedysetmessages: + msg319147
2018-06-09 03:28:35eric.fahlgrensetmessages: + msg319133
2018-06-09 03:07:22terry.reedysetnosy: + paul.moore, tim.golden, zach.ware, eryksun, steve.dower
messages: + msg319132
components: + Windows
2018-06-09 01:19:45eric.fahlgrensetnosy: + eric.fahlgren
messages: + msg319123
2018-06-08 23:57:23terry.reedysetmessages: + msg319120
2016-04-24 20:26:42westley.martinezsetmessages: + msg264128
2016-04-07 16:45:46terry.reedysettitle: IDLE DPI Awareness -> Tk DPI awareness
nosy: + wordtech, - kbk, roger.serwy

messages: + msg262996

components: - IDLE, Library (Lib)
2016-04-06 15:42:25SilentGhostsetnosy: + terry.reedy, kbk, gpolo, roger.serwy, serhiy.storchaka
2016-04-06 02:53:48westley.martinezcreate