From 0bdc87ef78fdf8805a3fc79a398daa47c6260468 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 28 Dec 2025 19:40:22 +0000 Subject: [PATCH 1/3] Initial plan From 8511a51bdbb3e7763b55f70587b515d635b36368 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 28 Dec 2025 19:43:11 +0000 Subject: [PATCH 2/3] Add Windows DPI awareness for sharper UI on high-DPI displays Co-authored-by: bryfur <7673964+bryfur@users.noreply.github.com> --- build.py | 5 +++++ wow_sync.manifest | 23 +++++++++++++++++++++++ wow_sync/__main__.py | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 wow_sync.manifest diff --git a/build.py b/build.py index a506a22..40cf401 100644 --- a/build.py +++ b/build.py @@ -40,6 +40,11 @@ elif sys.platform == 'darwin': # macOS-specific: set bundle identifier for proper .app common_args.append('--osx-bundle-identifier=com.wowsync.app') +elif sys.platform == 'win32': + # Windows-specific: add DPI awareness manifest + manifest_path = ROOT / 'wow_sync.manifest' + if manifest_path.exists(): + common_args.append(f'--manifest={manifest_path}') print(f"Building WoW Sync for {sys.platform}...") PyInstaller.__main__.run(common_args) diff --git a/wow_sync.manifest b/wow_sync.manifest new file mode 100644 index 0000000..9b3c237 --- /dev/null +++ b/wow_sync.manifest @@ -0,0 +1,23 @@ + + + + WoW Addon and Settings Sync + + + + + + + + + + true + PerMonitorV2 + + + diff --git a/wow_sync/__main__.py b/wow_sync/__main__.py index c803c41..117fbd8 100644 --- a/wow_sync/__main__.py +++ b/wow_sync/__main__.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +import sys import tkinter as tk from tkinter import messagebox from async_tkinter_loop import async_mainloop @@ -6,7 +7,39 @@ from wow_sync.single_instance import SingleInstance +def enable_dpi_awareness(): + """Enable DPI awareness on Windows to prevent blurry UI.""" + if sys.platform == 'win32': + try: + # Try to use the newer SetProcessDpiAwarenessContext (Windows 10, version 1703+) + import ctypes + from ctypes import wintypes + + # Define DPI awareness context values + DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 = ctypes.c_void_p(-4) + + try: + # Try the newest API first (Windows 10 1703+) + ctypes.windll.user32.SetProcessDpiAwarenessContext( + DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 + ) + except (AttributeError, OSError): + # Fall back to SetProcessDpiAwareness (Windows 8.1+) + try: + ctypes.windll.shcore.SetProcessDpiAwareness(2) # PROCESS_PER_MONITOR_DPI_AWARE + except (AttributeError, OSError): + # Final fallback to SetProcessDPIAware (Windows Vista+) + try: + ctypes.windll.user32.SetProcessDPIAware() + except (AttributeError, OSError): + pass # DPI awareness not available + except Exception: + pass # Silently fail if DPI awareness cannot be set + + def main(): + # Enable DPI awareness before creating any windows + enable_dpi_awareness() # Enforce single instance instance_lock = SingleInstance() if not instance_lock.acquire(): From 23b654e4426311c80fc6298fc2abd29de1a777b2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 28 Dec 2025 19:44:13 +0000 Subject: [PATCH 3/3] Address code review feedback: remove unused import and use named constant Co-authored-by: bryfur <7673964+bryfur@users.noreply.github.com> --- wow_sync/__main__.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/wow_sync/__main__.py b/wow_sync/__main__.py index 117fbd8..d89d396 100644 --- a/wow_sync/__main__.py +++ b/wow_sync/__main__.py @@ -11,12 +11,11 @@ def enable_dpi_awareness(): """Enable DPI awareness on Windows to prevent blurry UI.""" if sys.platform == 'win32': try: - # Try to use the newer SetProcessDpiAwarenessContext (Windows 10, version 1703+) import ctypes - from ctypes import wintypes - # Define DPI awareness context values + # Define DPI awareness constants DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 = ctypes.c_void_p(-4) + PROCESS_PER_MONITOR_DPI_AWARE = 2 try: # Try the newest API first (Windows 10 1703+) @@ -26,7 +25,7 @@ def enable_dpi_awareness(): except (AttributeError, OSError): # Fall back to SetProcessDpiAwareness (Windows 8.1+) try: - ctypes.windll.shcore.SetProcessDpiAwareness(2) # PROCESS_PER_MONITOR_DPI_AWARE + ctypes.windll.shcore.SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE) except (AttributeError, OSError): # Final fallback to SetProcessDPIAware (Windows Vista+) try: