I had an issue with icon size which only affects Windows for some reason. My application uses GtkSpinner with a custom size of 48px.
GtkSpinner which uses -gtk-icontheme(“process-working-symbolic“) appears blurry because the only size of this icon on Windows is 16px. I checked Adwaita icon theme in a Linux distro and MSYS2 mingw repos, neither had icon with the same name.
I managed to find it in GTK Inspector under /org/gtk/libgtk/icons/scalable/status/process-working-symbolic.svg but I still couldn’t get it to show up in Windows build even after including same svg in shared/icons/Adwaita theme
Include all the icons that gtk is using itself. For now, we include size 16 and scalable, to keep
the size limited.
Now, the newly released GTK 4.20 has a built-in SVG parser [1] [2], but earlier releases rely on the SVG pixbuf loader provided by mingw-w64-librsvg. Probably the issue will go away once mingw-w64-librsvg is installed.
@lb90 Hi. The Windows version of my application is meant to be portable. How do I include it properly in release build? I tried putting lib/gdk-pixbuf-2.0/, share/gir-1.0/ and librsvg-2-2.dll in directory with .exe but that didn’t work.
gdk-pixbuf-query-loaders --update-cache. It updates the file in lib/gdk-pixbuf-2.0/2.10.0/loaders/loaders.cache, which is actually a textual file. Open loaders.cache in a text editor and check if ti contains an entry for svg
(not strictly necessary) gtk4-update-icon-cache C:/path/to/app/bundle/share/icons/<icontheme> -f. This updates share/icons/<icontheme>/icon-theme.cache, and should be done for each icon theme you have under share/icons Not really needed for the spinner icon as it’s in GTK, but that way you enable scalable icons provided by icon themes.
The two tools should be present in bin/ alongside your app’s executable file
The command .\gdk-pixbuf-query-loaders.exe --update-cache failed for me with the following message:
g_module_open() failed for Z:\Stuff\Windows\Games\microlauncher\lib\gdk-pixbuf-2.0\2.10.0\loaders\pixbufloader_svg.dll: ‘Z:\Stuff\Windows\Games\microlauncher\lib\gdk-pixbuf-2.0\2.10.0\loaders\pixbufloader_svg.dll’: The specified module could not be found.
librsvg-2-2.dll is located under Z:\Stuff\Windows\Games\microlauncher\bin and that’s the same directory which I executed .\gdk-pixbuf-query-loaders.exe from. Z:\Stuff\Windows\Games\microlauncher\lib\gdk-pixbuf-2.0\2.10.0\loaders\pixbufloader_svg.dll also exists in the specified path.
I’m using CMake to determine runtime dependencies. It still misses some of them so I have to add them manually.