From 937eacfb63e026030e4f010097c3c2e8f8a0cbf6 Mon Sep 17 00:00:00 2001
From: Mat <mail@mathias.is>
Date: Fri, 1 Nov 2024 23:02:03 +0200
Subject: [PATCH] theme.py: fix crash in older GTK 4 versions on macOS

Fixes #3172
---
 pynicotine/gtkgui/widgets/theme.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/pynicotine/gtkgui/widgets/theme.py b/pynicotine/gtkgui/widgets/theme.py
index cd7163f04418..bb234d133810 100644
--- pynicotine/gtkgui/widgets/theme.py
+++ pynicotine/gtkgui/widgets/theme.py
@@ -148,7 +148,11 @@ def set_default_font_size():
         return
 
     # Enable OS-specific font tweaks
-    GTK_SETTINGS.props.gtk_font_rendering = Gtk.FontRendering.MANUAL  # pylint: disable=no-member
+    try:
+        GTK_SETTINGS.props.gtk_font_rendering = Gtk.FontRendering.MANUAL  # pylint: disable=no-member
+    except AttributeError:
+        # GTK <4.16
+        pass
 
 
 def set_visual_settings():
