diff --git a/qt/aqt/__init__.py b/qt/aqt/__init__.py index e6b07f940..3a3605c9c 100644 --- a/qt/aqt/__init__.py +++ b/qt/aqt/__init__.py @@ -461,6 +461,14 @@ def _run(argv: Optional[List[str]] = None, exec: bool = True) -> Optional[AnkiAp profiler = cProfile.Profile() profiler.enable() + if ( + isWin + and getattr(sys, "frozen", False) + and os.getenv("QT_QPA_PLATFORM") == "wayland" + ): + # the packaged builds currently do not support wayland natively + os.environ["QT_QPA_PLATFORM"] = "xcb" + # default to specified/system language before getting user's preference so that we can localize some more strings lang = anki.lang.get_def_lang(opts.lang) anki.lang.set_lang(lang[1])