From b1d793b2dbbdfe0b8e912e446bc824bed3ebbef1 Mon Sep 17 00:00:00 2001 From: Leandro Date: Sat, 31 Jan 2026 21:06:51 -0300 Subject: [PATCH 1/2] Adds HiDPI support for Windows 10/11 --- ProperTree.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ProperTree.py b/ProperTree.py index 134131cb..2957865c 100755 --- a/ProperTree.py +++ b/ProperTree.py @@ -23,6 +23,13 @@ sys.path.append(os.path.abspath(os.path.dirname(__file__))) from Scripts import plist, plistwindow, downloader +# HiDPI fix for Windows 10/11 +if os.name == 'nt': + try: + ctypes.windll.shcore.SetProcessDpiAwareness(1) + except: + pass + def _check_for_update(queue, version_url = None, user_initiated = False): args = [sys.executable] file_path = os.path.join(os.path.abspath(os.path.dirname(__file__)),"Scripts","update_check.py") From 6dc70eafb3da37f891fa673c205ebdfe081b218b Mon Sep 17 00:00:00 2001 From: Mozi <29089388+pzhlkj6612@users.noreply.github.com> Date: Fri, 10 Apr 2026 12:51:19 -0400 Subject: [PATCH 2/2] Adds HiDPI support by reusing existing scripts for more Windows versions (#1) --- ProperTree.py | 13 ++++++------- Scripts/config_tex_info.py | 6 ------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/ProperTree.py b/ProperTree.py index 2957865c..11607db7 100755 --- a/ProperTree.py +++ b/ProperTree.py @@ -23,13 +23,6 @@ sys.path.append(os.path.abspath(os.path.dirname(__file__))) from Scripts import plist, plistwindow, downloader -# HiDPI fix for Windows 10/11 -if os.name == 'nt': - try: - ctypes.windll.shcore.SetProcessDpiAwareness(1) - except: - pass - def _check_for_update(queue, version_url = None, user_initiated = False): args = [sys.executable] file_path = os.path.join(os.path.abspath(os.path.dirname(__file__)),"Scripts","update_check.py") @@ -86,6 +79,12 @@ def __init__(self, plists = []): self.queue = multiprocessing.Queue() self.tex_queue = multiprocessing.Queue() self.creating_window = False + # HiDPI fix for Windows + if os.name == "nt": + try: # >= win 8.1 + ctypes.windll.shcore.SetProcessDpiAwareness(2) + except: # win 8.0 or less + ctypes.windll.user32.SetProcessDPIAware() # Create the new tk object self.tk = tk.Tk() self.tk.withdraw() # Try to remove before it's drawn diff --git a/Scripts/config_tex_info.py b/Scripts/config_tex_info.py index 5218fb19..f2548f2b 100644 --- a/Scripts/config_tex_info.py +++ b/Scripts/config_tex_info.py @@ -109,12 +109,6 @@ def set(self, low, high): # Madness to get the titlebar height offset_y = 0 - 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() offset_y = int(info_window.geometry().rsplit('+', 1)[-1]) bar_height = info_window.winfo_rooty() - offset_y