I have difficulties to understand the icon system in GTK 4 (I work in C language). In GTK 2 and 3 that was easy to instruct the OS about the icon to use for displaying the apps.
In GTK 4 the set_icon functions have been removed which let us with the theming system.
I understand that, by default, gtk want us to follow the Freedesktop Icon Theme Specification and so to put the icons during the installation in directories like /usr/local/share/icons/hicolor/ and setting it in the application via function like gtk_window_set_default_icon_name or gtk_window_set_icon_name. But I didn't really manage to make this system work.
Moreover, it remains obscure to me what happens on other systems that are not gnome-based like Windows (or even KDE desktop)...
So, well, I have a few questions that stem from theses previous points :
How the system work on other OS or DE that do not follow the Freedesktop Icon Theme Specification ?
Is this possible to have a very short working example that illustrates how to use, in GTK4, a new application icons that, for example, was just copied in /usr/local/share/icons/hicolor/
And my real question for my use case : is this still possible, by one way or another, to include applications icons in the binary or in the binary directory to have a simple portable application which do not need installations and work on every system ?
(edit : edited to include nielsdg precision)