From 661445775940b3e692e6ae96660c3b2e1a8f5b32 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 15 May 2023 14:34:01 +1000 Subject: [PATCH] Add fractional scaling workaround --- qt/aqt/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qt/aqt/__init__.py b/qt/aqt/__init__.py index 134d6ce83..bbff3e54e 100644 --- a/qt/aqt/__init__.py +++ b/qt/aqt/__init__.py @@ -576,6 +576,11 @@ def _run(argv: Optional[list[str]] = None, exec: bool = True) -> Optional[AnkiAp if os.environ.get("ANKI_SOFTWAREOPENGL"): QCoreApplication.setAttribute(Qt.ApplicationAttribute.AA_UseSoftwareOpenGL) + # Work around broken fractional scaling in Wayland + # https://bugreports.qt.io/browse/QTBUG-113574 + if is_lin and qtmajor > 5: + os.environ["QT_SCALE_FACTOR_ROUNDING_POLICY"] = "RoundPreferFloor" + # fix an issue on Windows, where Ctrl+Alt shortcuts are triggered by AltGr, # preventing users from typing things like "@" through AltGr+Q on a German # keyboard.