From 7de5e8214e29d35ef4d4e96ae98ecf8b98f02908 Mon Sep 17 00:00:00 2001 From: thegamecracks <61257169+thegamecracks@users.noreply.github.com> Date: Wed, 20 Mar 2024 19:45:37 -0400 Subject: [PATCH] feat: enable DPI awareness on windows --- src/dumdum/client/__main__.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/dumdum/client/__main__.py b/src/dumdum/client/__main__.py index 1915b06..40dc2e0 100644 --- a/src/dumdum/client/__main__.py +++ b/src/dumdum/client/__main__.py @@ -4,6 +4,7 @@ import argparse import contextlib +import platform from typing import Iterator from dumdum.logging import configure_logging @@ -41,6 +42,7 @@ def main(): mode: str = args.mode configure_logging(verbose) + enable_windows_dpi_awareness() if mode == "gui": run_gui() @@ -60,6 +62,13 @@ def run_gui() -> None: app.mainloop() +def enable_windows_dpi_awareness(): + if platform.system() == "Windows": + from ctypes import windll + + windll.shcore.SetProcessDpiAwareness(2) + + def show_appdirs() -> None: from dumdum.appdirs import APP_DIRS