From 1a920ba955169c0bd5a2bd062d9b6638e5de6180 Mon Sep 17 00:00:00 2001 From: deepend Date: Tue, 17 Feb 2026 21:30:51 -0700 Subject: [PATCH] I fixed the Windows runtime path so gdk-pixbuf can actually find/use its loader modules before GTK initializes, by adding win32_configure_pixbuf_loaders() and calling it in startup on Windows. This sets GDK_PIXBUF_MODULEDIR / GDK_PIXBUF_MODULE_FILE from the bundled install tree so SVG resources can render instead of placeholder icons. I also fixed Windows packaging to include what the SVG path needs at runtime: librsvg DLLs, gdk-pixbuf loader modules, and loaders.cache in the release bundle. --- src/fe-gtk/fe-gtk.c | 48 +++++++++++++++++++++++++++++++++++++++++ win32/copy/copy.vcxproj | 5 +++++ 2 files changed, 53 insertions(+) diff --git a/src/fe-gtk/fe-gtk.c b/src/fe-gtk/fe-gtk.c index c75bc748..07bab186 100644 --- a/src/fe-gtk/fe-gtk.c +++ b/src/fe-gtk/fe-gtk.c @@ -174,6 +174,53 @@ win32_set_gsettings_schema_dir (void) g_free (base_path); } + +static void +win32_configure_pixbuf_loaders (void) +{ + char *base_path; + char *pixbuf_root; + GDir *versions; + const gchar *entry; + + base_path = g_win32_get_package_installation_directory_of_module (NULL); + if (!base_path) + return; + + pixbuf_root = g_build_filename (base_path, "lib", "gdk-pixbuf-2.0", NULL); + if (!g_file_test (pixbuf_root, G_FILE_TEST_IS_DIR)) + { + g_free (pixbuf_root); + g_free (base_path); + return; + } + + versions = g_dir_open (pixbuf_root, 0, NULL); + if (versions) + { + while ((entry = g_dir_read_name (versions)) != NULL) + { + char *module_dir = g_build_filename (pixbuf_root, entry, "loaders", NULL); + char *module_file = g_build_filename (pixbuf_root, entry, "loaders.cache", NULL); + + if (g_file_test (module_dir, G_FILE_TEST_IS_DIR)) + g_setenv ("GDK_PIXBUF_MODULEDIR", module_dir, TRUE); + if (g_file_test (module_file, G_FILE_TEST_EXISTS)) + g_setenv ("GDK_PIXBUF_MODULE_FILE", module_file, TRUE); + + g_free (module_file); + g_free (module_dir); + + if (g_getenv ("GDK_PIXBUF_MODULEDIR") != NULL) + break; + } + g_dir_close (versions); + } + + g_free (pixbuf_root); + g_free (base_path); +} + static void win32_configure_icon_theme (void) { @@ -307,6 +354,7 @@ fe_args (int argc, char *argv[]) #ifdef WIN32 win32_set_gsettings_schema_dir (); + win32_configure_pixbuf_loaders (); /* this is mainly for irc:// URL handling. When windows calls us from */ /* I.E, it doesn't give an option of "Start in" directory, like short */ diff --git a/win32/copy/copy.vcxproj b/win32/copy/copy.vcxproj index 63cc564c..5830519a 100644 --- a/win32/copy/copy.vcxproj +++ b/win32/copy/copy.vcxproj @@ -67,6 +67,7 @@ + @@ -82,6 +83,8 @@ + + @@ -95,6 +98,8 @@ + +