Hum, interesting, maybe this point should be added in the documentation ?
I don’t really understand the « and you are on X11 » . Why is that so ? So gtk_window_set_icon_name() has no effect at all on wayland ?
If that is the case, it really should be added in the documentation of GTK4 ^^
I have put the code in the first post :
The part that load the icon is really short :
icon_theme = gtk_icon_theme_get_for_display (gdk_display_get_default ());
gtk_icon_theme_add_search_path(icon_theme,path_to_my_ressource_directory);
if(gtk_icon_theme_has_icon(icon_theme,"my-icon")!=1)
{
// manage error
}
gtk_window_set_default_icon_name("my-icon"); // default icon for all windows if nothing is set explicitly if I understand well.
window = gtk_application_window_new (app);
gtk_window_set_title (GTK_WINDOW (window), "Your app");
gtk_window_set_icon_name(GTK_WINDOW (window),"my-icon"); // set explicitly the icon for the min window
My icon is in the directory MY_APP_DIRECTORY/ressources/hicolor which contain the following directory :
128x128 150x150 192x192 256x256 310x310 48x48 512x512 64x64 72x72 96x96 scalable
In each one there is an apps directory and a png icon in this apps directory, (my-icon.png), with the right size of course. (except in scalable where there is an svg icon).
The icon used is indeed the 48x48, because if i put a text on each icon its that one. But, as far as i understand, it shouldn’t. And it is not the case in previous version of GTK.