GNOME Bugzilla – Bug 705860
Recent deprecation change breaks existing users of gtk_recent_info_get_icon
Last modified: 2013-09-20 09:05:22 UTC
The removal of the gtkiconfactory.h include from gtkrecentmanager.c in commit 2f1fa7cdc3735b13561f27345f43ed3ac6883d8e[1] breaks use of gtk_recent_info_get_icon when passing a GtkIconSize enum as the size parameter. 1. https://git.gnome.org/browse/gtk+/commit/?id=2f1fa7cdc3735b13561f27345f43ed3ac6883d8e
I don't see how it could, really. The code compiles without warnings. Can you produce a test case ?
Created attachment 251792 [details] Test case demonstrating use of gtk_recent_info_get_icon with GTK_ICON_SIZE_BUTTON Apologies if I've incorrectly root caused this. I noticed something was wrong when I switched to building Brasero against master (instead of 3.8.2) and made the following change to prevent the observed segfault: https://git.gnome.org/browse/brasero/commit/?id=2eb68c9855e202899a3ab71d14d884c80c57b38a Attached is a reduced test case which mimics what is done in the Brasero code, the commented out lines reflect the change I made in the Brasero commit above to workaround the segfault, namely using gtk_recent_info_get_gicon () rather than gtk_recent_info_get_icon (). Here's the output of running my test program against gtk+ master: $ ./test Gtk-Message: Failed to load module "pk-gtk-module" Gtk-Message: Failed to load module "canberra-gtk-module" (test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_scale_simple: assertion 'dest_width > 0' failed (test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_rowstride: assertion 'GDK_IS_PIXBUF (pixbuf)' failed (test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_height: assertion 'GDK_IS_PIXBUF (pixbuf)' failed (test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_width: assertion 'GDK_IS_PIXBUF (pixbuf)' failed (test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_bits_per_sample: assertion 'GDK_IS_PIXBUF (pixbuf)' failed (test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_has_alpha: assertion 'GDK_IS_PIXBUF (pixbuf)' failed (test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_colorspace: assertion 'GDK_IS_PIXBUF (pixbuf)' failed (test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_pixels: assertion 'GDK_IS_PIXBUF (pixbuf)' failed (test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_new_from_data: assertion 'data != NULL' failed (test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_scale_simple: assertion 'dest_width > 0' failed (test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_rowstride: assertion 'GDK_IS_PIXBUF (pixbuf)' failed (test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_height: assertion 'GDK_IS_PIXBUF (pixbuf)' failed (test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_width: assertion 'GDK_IS_PIXBUF (pixbuf)' failed (test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_bits_per_sample: assertion 'GDK_IS_PIXBUF (pixbuf)' failed (test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_has_alpha: assertion 'GDK_IS_PIXBUF (pixbuf)' failed (test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_colorspace: assertion 'GDK_IS_PIXBUF (pixbuf)' failed (test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_pixels: assertion 'GDK_IS_PIXBUF (pixbuf)' failed (test:13621): GdkPixbuf-CRITICAL **: gdk_pixbuf_new_from_data: assertion 'data != NULL' failed ** Gtk:ERROR:gtkrecentmanager.c:1960:get_icon_fallback: assertion failed: (retval != NULL) Aborted (core dumped)
> pix = gtk_recent_info_get_icon (info, GTK_ICON_SIZE_BUTTON); I don't see how this could have ever worked - the size parameter to gtk_recent_info_get_icon is a pixel size, not a symbolic icon size. You are trying to load a 4x4 icon here.
Thanks for taking the time to look at this Matthias, I only recently inherited this code and noticed a crash when building against newer gtk+.