GtkImage: add async backend
When creating a UI containing many GtkImage
's such as application launchers it's often visible that Gtk internally loads these synchronously which causes significant slow-downs.
While this is generally not an issue on SSD's, it is especially true when dealing with slower hard drives and a lot of image reads.
I think it could be beneficial for the GtkImage
API to expose some kind of way to load icons, images asynchronously considering the fact that API's like GtkIconInfo
already contain a set of _async
methods or even make the async backend default (which could probably also break a lot of stuff).
Now I don't have a proposal for how the API could look like or if it is already the case with GTK4.
A while ago I wrote a little AsyncImage class in Vala for just loading images asynchronously for elementary. The widget internally does most things the same way as Gtk, the only difference being that it calls gtk_icon_info_load_symbolic_for_context_async
method instead of the sync one.
This allowed the app menu in elementary which is built entirely in Gtk, to be much quicker and responsive.
Feedback welcome.