Gtk3 on Windows uses any 'bin' in a path to find application data

I’ve noticed an interesting bug with Gtk3 on Windows: when a path to a binary contains ‘bin’, Gtk3 will try to load data using that bin/, even with something like “C:\bin\foo\bar\my-project”.

Now, ‘my-project’ doesn’t have a bin/ dir with binaries and DLL’s, so Gtk3 fails. Is this correct? I’d expect Gtk3/Glib to check a ‘bin’ dir as the direct parent of a binary, not the entire path.

Yes, here’s the documentation: https://developer.gnome.org/glib/stable/glib-Windows-Compatibility-Functions.html#g-win32-get-package-installation-directory-of-module

If that directory’s last component is “bin” or “lib”, its parent directory is returned, otherwise the directory itself.

So I’d expect as you say that it checks the direct parent of the exe and only that.

Here’s the source code:

https://gitlab.gnome.org/GNOME/glib/-/blob/7cb5cd8d98ce08efc310aaeafa49a772ceb5d54e/glib/gwin32.c#L222

But actually it checks all components of the path.

https://gitlab.gnome.org/GNOME/glib/-/commit/786590fe93682c9b28136ccf65d870b23dd807f7

Nice, thanks for the fix, Meanwhile I updated our Windows bindist to use bin/ for binaries and DLL’s, adhering to the Gtk rules.

Ah never mind, that doesn’t fix anything,