From 926f0c7929af7168d614b6b4190043a04c6439ba Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 14 Sep 2021 09:53:23 +1000 Subject: [PATCH] disable wayland again, but allow enabling it Will add an entry to the known issues page. --- qt/aqt/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/qt/aqt/__init__.py b/qt/aqt/__init__.py index d3567db06..82e87ed4d 100644 --- a/qt/aqt/__init__.py +++ b/qt/aqt/__init__.py @@ -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])