Compact GTK 4 app on Windows, where to put icons

I decided to try creating a compact application with GTK 4 on windows. By compact, I mean non-installable. I installed GTK 4 via MSYS2, removed msys/bin from the environment variables, and added the necessary dlls to the same exe folder, here is the list:

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----        14.03.2021      0:32         362127 app_name.exe
-a----        12.02.2021     17:31          53884 gdbus.exe
-a----        25.10.2020     11:03         143395 libbrotlicommon.dll
-a----        25.10.2020     11:03          52874 libbrotlidec.dll
-a----        25.10.2020     11:03         654449 libbrotlienc.dll
-a----        22.12.2020     20:31          99146 libbz2-1.dll
-a----        15.02.2021      0:23        1093667 libcairo-2.dll
-a----        15.02.2021      0:23          35092 libcairo-gobject-2.dll
-a----        15.02.2021      0:23         164640 libcairo-script-interpreter-2.dll
-a----        22.08.2018     21:08          36029 libdatrie-1.dll
-a----        11.01.2021     16:12        1736233 libepoxy-0.dll
-a----        16.10.2020     15:50         193832 libexpat-1.dll
-a----        08.01.2021     15:38          30354 libffi-7.dll
-a----        05.12.2020     13:54         314046 libfontconfig-1.dll
-a----        21.10.2020     15:41         723628 libfreetype-6.dll
-a----        24.10.2020     14:51         143321 libfribidi-0.dll
-a----        09.03.2021     19:49          81585 libgcc_s_seh-1.dll
-a----        17.02.2021     22:36        1203846 libgcrypt-20.dll
-a----        21.01.2021     10:15         166889 libgdk_pixbuf-2.0-0.dll
-a----        12.02.2021     17:31        1586848 libgio-2.0-0.dll
-a----        12.02.2021     17:31        1291076 libglib-2.0-0.dll
-a----        12.02.2021     17:31          23678 libgmodule-2.0-0.dll
-a----        12.02.2021     17:31         312692 libgobject-2.0-0.dll
-a----        30.12.2020      3:25         200785 libgpg-error-0.dll
-a----        12.02.2021     17:41         132669 libgraphene-1.0-0.dll
-a----        10.09.2020      3:45         154163 libgraphite2.dll
-a----        13.02.2021     17:22        7793067 libgtk-4-1.dll
-a----        29.12.2020     19:59        1009284 libharfbuzz-0.dll
-a----        18.12.2020      1:29        1058528 libiconv-2.dll
-a----        22.12.2020     23:49         133659 libintl-8.dll
-a----        02.03.2017     15:52         143727 liblzo2-2.dll
-a----        12.02.2021     17:45         297137 libpango-1.0-0.dll
-a----        12.02.2021     17:45          72236 libpangocairo-1.0-0.dll
-a----        12.02.2021     17:45          95436 libpangoft2-1.0-0.dll
-a----        12.02.2021     17:45          91527 libpangowin32-1.0-0.dll
-a----        22.12.2020     20:39         281183 libpcre-1.dll
-a----        24.10.2020     15:15         684803 libpixman-1-0.dll
-a----        23.04.2019     12:24         231911 libpng16-16.dll
-a----        09.03.2021     19:49        1752711 libstdc++-6.dll
-a----        12.11.2018     10:46          68018 libthai-0.dll
-a----        26.01.2021      4:04         400252 libvulkan-1.dll
-a----        09.03.2021     23:24          58539 libwinpthread-1.dll
-a----        05.01.2021     19:54         116428 zlib1.dll

Now running the exe I get the following log:

(process:3728): Gdk-CRITICAL **: 01:29:28.222: gdk_display_get_clipboard: assertion 'GDK_IS_DISPLAY (display)' failed

(app_name.exe:3728): Gtk-WARNING **: 01:29:28.368: Failed to load icon /org/gtk/libgtk/icons/16x16/status/eye-not-looking-symbolic.symbolic.png: Image type Š²??pngŠ²?? is not supported

(app_name.exe:3728): Gtk-WARNING **: 01:29:28.465: Failed to load icon /org/gtk/libgtk/icons/16x16/status/dialog-information-symbolic.symbolic.png: Image type Š²??pngŠ²?? is not supported

(app_name.exe:3728): Gtk-WARNING **: 01:29:28.465: Failed to load icon /org/gtk/libgtk/icons/16x16/status/caps-lock-symbolic.symbolic.png: Image type Š²??pngŠ²?? is not supported
**
Gtk:ERROR:../gtk-4.0.3/gtk/gtkicontheme.c:3823:icon_ensure_texture__locked: assertion failed: (source_pixbuf != NULL)
**
Gtk:ERROR:../gtk-4.0.3/gtk/gtkicontheme.c:3823:icon_ensure_texture__locked: assertion failed: (source_pixbuf != NULL)
B**
Gtk:ERROR:../gtk-4.0.3/gtk/gtkicontheme.c:3823:icon_ensure_texture__locked: assertion failed: (source_pixbuf != NULL)
ail out! Gtk:ERROR:../gtk-4.0.3/gtk/gtkicontheme.c:3823:icon_ensure_texture__locked: assertion failed: (source_pixbuf != NULL)
Bail out! Gtk:ERROR:../gtk-4.0.3/gtk/gtkicontheme.c:3823:icon_ensure_texture__locked: assertion failed: (source_pixbuf != NULL)
Bail out! Gtk:ERROR:../gtk-4.0.3/gtk/gtkicontheme.c:3823:icon_ensure_texture__locked: assertion failed: (source_pixbuf != NULL)

So I copied Adwaita folder from msys2, but I dont know how I need to put it near exe so exe can find it.
ls in Adwaita folder:

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----        14.03.2021      1:22                16x16
d-----        14.03.2021      1:22                22x22
d-----        14.03.2021      1:22                24x24
d-----        14.03.2021      1:22                256x256
d-----        14.03.2021      1:22                32x32
d-----        14.03.2021      1:22                48x48
d-----        14.03.2021      1:22                512x512
d-----        14.03.2021      1:22                64x64
d-----        14.03.2021      1:22                8x8
d-----        14.03.2021      1:22                96x96
d-----        14.03.2021      1:22                cursors
d-----        14.03.2021      1:22                scalable
d-----        14.03.2021      1:22                scalable-up-to-32
-a----        13.03.2021     23:59         116048 icon-theme.cache
-a----        10.01.2021     22:11           7505 index.theme

Youā€™re missing the PNG loader for gdk-pixbuf.

I got a similar error from gdk-pixbuf for SVG, while running an app ( SVG app icon image ) in docker.

Iā€™m assuming gdk-pixbuf should have a ā€œRequires:ā€ build time dependency and ā€œRecommends:ā€ run time dependency on all supported image formats, and the distro got the runtime dependency wrong ?

Thanks!

I added all libpixbufloader-*.dll from C:\msys64\mingw64\lib\gdk-pixbuf-2.0\2.10.0\loaders but have same error. libpixbufloader-png.dll was one of them.

Did you generate the loaders.cache file using gdk-pixbuf-query-loaders?

Alternatively, you can rebuild gdk-pixbuf with all the loaders built in.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.