From 5fdd3543f0bf9b6b58c5954393e81eba99dd2581 Mon Sep 17 00:00:00 2001 From: Kris Cherven Date: Tue, 11 Mar 2025 23:57:42 -0400 Subject: [PATCH 1/3] Fix broken window decorations on unpackaged GNOME instances --- pylib/anki/utils.py | 4 ++++ qt/aqt/__init__.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pylib/anki/utils.py b/pylib/anki/utils.py index b5382e6df94..1b42126208b 100644 --- a/pylib/anki/utils.py +++ b/pylib/anki/utils.py @@ -248,6 +248,10 @@ def call(argv: list[str], wait: bool = True, **kwargs: Any) -> int: 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", "") diff --git a/qt/aqt/__init__.py b/qt/aqt/__init__.py index af3797049cc..fb922252124 100644 --- a/qt/aqt/__init__.py +++ b/qt/aqt/__init__.py @@ -59,7 +59,7 @@ 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 From b3df3a9603c6e4a8f091a5ac32232315f47b8095 Mon Sep 17 00:00:00 2001 From: Kris Cherven Date: Mon, 17 Mar 2025 12:17:56 -0400 Subject: [PATCH 2/3] Fix CONTRIBUTORS detection --- CONTRIBUTORS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 07b3e84894f..a63e1a197be 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -192,7 +192,7 @@ Themis Demetriades Luke Bartholomew Gregory Abrasaldo Taylor Obyen <162023405+taylorobyen@users.noreply.github.com> -Kris Cherven +Kris Cherven twwn Cy Pokhrel Park Hyunwoo From 2cf7717841044462d86f0d6a97ba022aff841e19 Mon Sep 17 00:00:00 2001 From: Kris Cherven Date: Mon, 17 Mar 2025 12:18:05 -0400 Subject: [PATCH 3/3] Fix CONTRIBUTORS --- CONTRIBUTORS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index a63e1a197be..07b3e84894f 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -192,7 +192,7 @@ Themis Demetriades Luke Bartholomew Gregory Abrasaldo Taylor Obyen <162023405+taylorobyen@users.noreply.github.com> -Kris Cherven +Kris Cherven twwn Cy Pokhrel Park Hyunwoo