disable wayland again, but allow enabling it

Will add an entry to the known issues page.
This commit is contained in:
Damien Elmes 2021-09-14 09:53:23 +10:00
parent 18bd821a1f
commit 926f0c7929

View file

@ -477,6 +477,14 @@ def _run(argv: Optional[List[str]] = None, exec: bool = True) -> Optional[AnkiAp
profiler = cProfile.Profile()
profiler.enable()
if (
getattr(sys, "frozen", False)
and os.getenv("QT_QPA_PLATFORM") == "wayland"
and not os.getenv("ANKI_WAYLAND")
):
# users need to opt in to wayland support, given the issues it has
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])