GNOME Bugzilla – Bug 701119
Error messages when GtkAboutDialog shows license info
Last modified: 2014-01-25 16:15:03 UTC
When a GtkAboutDialog is shown and you press the License button, these messages are printed: (testaboutdialog:2353): GLib-GObject-WARNING **: g_object_set_valist: object class 'GtkTextTag' has no property named 'font-scale' (testaboutdialog:2353): Gtk-CRITICAL **: gtk_text_buffer_apply_tag: assertion 'tag->priv->table == buffer->priv->tag_table' failed Steps to reproduce: Start the test program that I will very soon attach to this bug report. Press the License button. Actual results: Error messages as above. Part of backtraces:
+ Trace 231996
Expected results: No error messages. Build date and platform: Ubuntu 12.04. Source code of gtk+, etc. from git's master branch, built with jhbuild on 2013-05-27. Additional information: The messages are printed as a result of these two function calls in gtkaboutdialog.c: g_object_set (tag, "font-scale", PANGO_SCALE_SMALL, NULL); gtk_text_buffer_apply_tag (buffer, tag, &start_iter, &end_iter); These lines were added by this commit: https://git.gnome.org/browse/gtk+/commit/?id=fbbb66ae7d19516b7a99de3d8b0a96164fb3ead2
Created attachment 245430 [details] testaboutdialog.c
If you replace gtk_text_buffer_get_start_iter (buffer, &start_iter); gtk_text_buffer_get_start_iter (buffer, &end_iter); tag = gtk_text_tag_new (NULL); g_object_set (tag, "font-scale", PANGO_SCALE_SMALL, NULL); gtk_text_buffer_apply_tag (buffer, tag, &start_iter, &end_iter); by gtk_text_buffer_get_start_iter (buffer, &start_iter); gtk_text_buffer_get_start_iter (buffer, &end_iter); tag = gtk_text_buffer_create_tag (buffer, NULL, "scale", PANGO_SCALE_SMALL, NULL); gtk_text_buffer_apply_tag (buffer, tag, &start_iter, &end_iter); the error messages disappear, but this code does not do anything useful. It applies the tag to an empty range in an empty text buffer. If you instead replace that code near the start of text_buffer_new() by gtk_text_buffer_get_start_iter (buffer, &start_iter); gtk_text_buffer_get_end_iter (buffer, &end_iter); tag = gtk_text_buffer_create_tag (buffer, NULL, "scale", PANGO_SCALE_SMALL, NULL); gtk_text_buffer_apply_tag (buffer, tag, &start_iter, &end_iter); at the end of text_buffer_new(), just before "return buffer;", then the license text becomes smaller.
Created attachment 245865 [details] [review] patch: GtkAboutDialog: Fix the font scale in the license box.
Can I push the patch?
I tried to CC Benjamin Otte <otte@redhat.com> who added the code that causes the error messages. Bugzilla refused to add him to the CC list.