GtkSpinner appears blurry in Windows build

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

Here’s what it’s supposed to look like (Linux)


Here’s what it looks like on Windows

Hi @Lassebq,

process-working-symbolic was dropped from adwaita-icon-theme. GTK includes it, but only in 16x16 and SVG variants:

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.

References:

  1. Convert symbolic icons to render nodes (!8547) · Merge requests · GNOME / gtk · GitLab
  2. Use librsvg for symbolics that we can't parse ourselves (!8541) · Merge requests · GNOME / gtk · GitLab
1 Like

@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.

Is there something that I might be missing?

You’ll need the following files:

  1. bin/librsvg-2-2.dll
  2. lib/gdk-pixbuf-2.0/2.10.0/loaders/pixbufloader_svg.dll

Then run:

  1. 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
  2. (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

Another question: did you bundle your app using MSYS2 or other package managers?

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.

I use dumpbin to detect library dependencies. From a Visual Studio x64 Developer Command Prompt:

dumpbin /DEPENDENTS librsvg-2-2.dll

Dump of file librsvg-2-2.dll

File Type: DLL

  Image has the following dependencies:

    libgcc_s_seh-1.dll
    KERNEL32.dll
    api-ms-win-crt-heap-l1-1-0.dll
    api-ms-win-crt-math-l1-1-0.dll
    api-ms-win-crt-private-l1-1-0.dll
    api-ms-win-crt-runtime-l1-1-0.dll
    api-ms-win-crt-stdio-l1-1-0.dll
    api-ms-win-crt-string-l1-1-0.dll
    ntdll.dll
    USERENV.dll
    WS2_32.dll
    libcairo-gobject-2.dll
    libcairo-2.dll
    libgdk_pixbuf-2.0-0.dll
    libgio-2.0-0.dll
    libglib-2.0-0.dll
    libgobject-2.0-0.dll
    libintl-8.dll
    libpango-1.0-0.dll
    libpangocairo-1.0-0.dll
    libxml2-16.dll
    api-ms-win-core-synch-l1-2-0.dll
    bcryptprimitives.dll
dumpbin /DEPENDENTS pixbufloader_svg.dll

Dump of file pixbufloader_svg.dll

File Type: DLL

  Image has the following dependencies:

    kernel32.dll
    ntdll.dll
    userenv.dll
    ws2_32.dll
    libgdk_pixbuf-2.0-0.dll
    libgio-2.0-0.dll
    libglib-2.0-0.dll
    libgobject-2.0-0.dll
    libintl-8.dll
    KERNEL32.dll
    api-ms-win-crt-heap-l1-1-0.dll
    api-ms-win-crt-private-l1-1-0.dll
    api-ms-win-crt-runtime-l1-1-0.dll
    api-ms-win-crt-stdio-l1-1-0.dll
    api-ms-win-crt-string-l1-1-0.dll
    ntdll.dll
    api-ms-win-core-synch-l1-2-0.dll
    bcryptprimitives.dll
    librsvg-2-2.dll

There other tools like Package: mingw-w64-x86_64-ntldd - MSYS2 Packages

Finally, you can enable Loader Snaps output to get a detailed log from the loader: GitHub - TimMisiak/LoaderLog: Small application that can be used to log loader snaps and other debug output.