After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 693802 - Add async GtkIconInfo loaders
Add async GtkIconInfo loaders
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-02-14 14:56 UTC by Alexander Larsson
Modified: 2013-02-14 21:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Make GtkIconInfo a GObject (4.40 KB, patch)
2013-02-14 14:57 UTC, Alexander Larsson
committed Details | Review
Add gtk_icon_info_load_icon_async (10.54 KB, patch)
2013-02-14 14:57 UTC, Alexander Larsson
committed Details | Review
GtkIconTheme Don't leak pixbuf in symbolic icon cache (981 bytes, patch)
2013-02-14 14:57 UTC, Alexander Larsson
committed Details | Review
GtkIconTheme: Add async versions of symbolic icon loaders (15.99 KB, patch)
2013-02-14 14:57 UTC, Alexander Larsson
committed Details | Review

Description Alexander Larsson 2013-02-14 14:56:37 UTC
The shell needs async versions of the gtk_icon_info icon load operations as they currently use the sync one in a thread, which breaks with the new cache code.
Comment 1 Alexander Larsson 2013-02-14 14:57:15 UTC
Created attachment 236067 [details] [review]
Make GtkIconInfo a GObject

This is necessary in order to have async operations on it.
All the old copy/free functions keeps working, and g_boxed_copy on a GObject
also works, so this should be mostly compatible, but techncally its a minor
ABI break since the GType changes fundamental type. Changes like this has
happened before though, like with GVariant becomming its own fundamental
type.
Comment 2 Alexander Larsson 2013-02-14 14:57:19 UTC
Created attachment 236068 [details] [review]
Add gtk_icon_info_load_icon_async

This lets you asynchronously load icons. We need this for gnome-shell
to replace its current non-threadsafe use of GtkIconTheme.
Comment 3 Alexander Larsson 2013-02-14 14:57:22 UTC
Created attachment 236069 [details] [review]
GtkIconTheme Don't leak pixbuf in symbolic icon cache

We need to unref the pixbuf we just put in the cache, because
symbolic_pixbuf_cache_new takes a ref.
Comment 4 Alexander Larsson 2013-02-14 14:57:26 UTC
Created attachment 236070 [details] [review]
GtkIconTheme: Add async versions of symbolic icon loaders
Comment 5 Matthias Clasen 2013-02-14 19:30:32 UTC
Review of attachment 236067 [details] [review]:

Its worth putting a note about it in a "Release Notes for 3.8" section in README.in - you have to scroll down a bit to find the release notes for older releases, just put it in front of that.
Comment 6 Matthias Clasen 2013-02-14 19:33:26 UTC
Review of attachment 236068 [details] [review]:

Looks good to me. Please add the new api to the docs when you commit this
Comment 7 Matthias Clasen 2013-02-14 19:34:10 UTC
Review of attachment 236069 [details] [review]:

ok
Comment 8 Matthias Clasen 2013-02-14 19:34:45 UTC
Review of attachment 236069 [details] [review]:

Would be great to have a test which checks that we're not leaking
Comment 9 Matthias Clasen 2013-02-14 19:35:46 UTC
Review of attachment 236070 [details] [review]:

ok

::: gtk/gtkicontheme.h
@@ +229,3 @@
+							  GAsyncResult         *res,
+							  gboolean      *was_symbolic,
+							  GError       **error);

Need to add GDK_AVAILABLE_IN_3_8 decorations to the new api here
Comment 10 Matthias Clasen 2013-02-14 19:36:15 UTC
Review of attachment 236068 [details] [review]:

::: gtk/gtkicontheme.h
@@ +210,3 @@
+GdkPixbuf *           gtk_icon_info_load_icon_finish  (GtkIconInfo          *icon_info,
+						       GAsyncResult         *res,
+						       GError              **error);

Need to add GDK_AVAILABLE_IN_3_8 here
Comment 11 Matthias Clasen 2013-02-14 19:36:37 UTC
Review of attachment 236070 [details] [review]:

and please add the new api to the docs when you commit this
Comment 12 Alexander Larsson 2013-02-14 21:11:49 UTC
Attachment 236067 [details] pushed as e2d0846 - Make GtkIconInfo a GObject
Attachment 236068 [details] pushed as 7690846 - Add gtk_icon_info_load_icon_async
Attachment 236069 [details] pushed as 23d5c41 - GtkIconTheme Don't leak pixbuf in symbolic icon cache
Attachment 236070 [details] pushed as f35ad7a - GtkIconTheme: Add async versions of symbolic icon loaders