Fix broken window decorations on unpackaged GNOME instances (#3858)

* Fix broken window decorations on unpackaged GNOME instances

* Fix CONTRIBUTORS detection

* Fix CONTRIBUTORS
This commit is contained in:
Kris Cherven 2025-03-19 10:58:42 +00:00 committed by GitHub
parent ffcc7612ab
commit 938c55ca01
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View file

@ -248,6 +248,10 @@ is_mac = sys.platform.startswith("darwin")
is_win = sys.platform.startswith("win32")
# also covers *BSD
is_lin = not is_mac and not is_win
is_gnome = (
"gnome" in os.getenv("XDG_CURRENT_DESKTOP", "").lower()
or "gnome" in os.getenv("DESKTOP_SESSION", "").lower()
)
dev_mode = os.getenv("ANKIDEV", "")
hmr_mode = os.getenv("HMR", "")

View file

@ -59,7 +59,7 @@ from anki._backend import RustBackend
from anki.buildinfo import version as _version
from anki.collection import Collection
from anki.consts import HELP_SITE
from anki.utils import checksum, is_lin, is_mac
from anki.utils import checksum, is_gnome, is_lin, is_mac
from aqt import gui_hooks
from aqt.log import setup_logging
from aqt.qt import *
@ -614,7 +614,7 @@ def _run(argv: list[str] | None = None, exec: bool = True) -> AnkiApp | None:
)
wayland_forced = os.getenv("ANKI_WAYLAND")
if packaged and wayland_configured:
if (packaged or is_gnome) and wayland_configured:
if wayland_forced or not x11_available:
# Work around broken fractional scaling in Wayland
# https://bugreports.qt.io/browse/QTBUG-113574