Skip to content

Adds HiDPI support for Windows Vista+#208

Open
leandroprz wants to merge 2 commits intocorpnewt:masterfrom
leandroprz:master
Open

Adds HiDPI support for Windows Vista+#208
leandroprz wants to merge 2 commits intocorpnewt:masterfrom
leandroprz:master

Conversation

@leandroprz
Copy link
Copy Markdown

When using Windows with scaling 125% or higher the text looks blurry, this PR fixes that.

Before:
no dpi

After:
dpi aware

Copy link
Copy Markdown

@pzhlkj6612 pzhlkj6612 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works, and we can take one more step.

Before applying this PR, I've found a weird behavior with the "Info" dialog (Ctrl-I) after loading "Configurations.tex":

Screenshot of resized window after opening 'info' dialog

Then I've seen these lines:

if os.name == "nt":
import ctypes
try: # >= win 8.1
ctypes.windll.shcore.SetProcessDpiAwareness(2)
except: # win 8.0 or less
ctypes.windll.user32.SetProcessDPIAware()

It should work fine in more versions of Windows. So I made a PR in your repository to move these lines to a proper place: leandroprz#1, please check.

@leandroprz leandroprz changed the title Adds HiDPI support for Windows 10/11 Adds HiDPI support for Windows 8+ Apr 10, 2026
@pzhlkj6612
Copy link
Copy Markdown

Well, SetProcessDPIAware() is an old API since Windows Vista. Check https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setprocessdpiaware .

@leandroprz leandroprz changed the title Adds HiDPI support for Windows 8+ Adds HiDPI support for Windows Vista+ Apr 10, 2026
@leandroprz
Copy link
Copy Markdown
Author

Wasn't aware, I just changed the title again to reflect that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants