From adea3e34afab86eccfba5e9957cc0621926151d0 Mon Sep 17 00:00:00 2001 From: Daemonratte Date: Thu, 15 Oct 2026 09:14:43 +0200 Subject: [PATCH] gtkmodules: also look in /usr/lib/gtk-2.0 on multiarch Based on Debian's 098_multiarch_module_path.patch by Steve Langasek, which Ardour's YTK carries as well. --- gtk/gtkmodules.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/gtk/gtkmodules.c b/gtk/gtkmodules.c index a325b3e56..50e231542 100644 --- a/gtk/gtkmodules.c +++ b/gtk/gtkmodules.c @@ -146,7 +146,22 @@ get_module_path (void) if (exe_prefix) default_dir = g_build_filename (exe_prefix, "lib", "gtk-2.0", NULL); else - default_dir = g_build_filename (GTK_LIBDIR, "gtk-2.0", NULL); + { + default_dir = g_build_filename (GTK_LIBDIR, "gtk-2.0", NULL); +#ifdef __linux__ + /* where theme engines and input methods were installed before + * multiarch (/usr/lib/), as Debian's GTK+ 2 looks too */ + if (strcmp (GTK_LIBDIR, "/usr/lib") != 0 && + g_str_has_prefix (GTK_LIBDIR, "/usr/lib/")) + { + gchar *both = g_build_path (G_SEARCHPATH_SEPARATOR_S, + default_dir, "/usr/lib/gtk-2.0", NULL); + + g_free (default_dir); + default_dir = both; + } +#endif + } if (module_path_env && home_gtk_dir) module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S,