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 701119 - Error messages when GtkAboutDialog shows license info
Error messages when GtkAboutDialog shows license info
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
3.9.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-05-28 07:26 UTC by Kjell Ahlstedt
Modified: 2014-01-25 16:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
testaboutdialog.c (531 bytes, text/plain)
2013-05-28 07:29 UTC, Kjell Ahlstedt
  Details
patch: GtkAboutDialog: Fix the font scale in the license box. (1.44 KB, patch)
2013-06-02 17:07 UTC, Kjell Ahlstedt
none Details | Review

Description Kjell Ahlstedt 2013-05-28 07:26:32 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:

  • #0 g_log
    at gmessages.c line 1021
  • #1 g_object_set_valist
    at gobject.c line 2095
  • #2 g_object_set
    at gobject.c line 2224
  • #3 text_buffer_new
    at gtkaboutdialog.c line 2066
  • #4 populate_license_page
    at gtkaboutdialog.c line 2348
  • #5 display_license_page
    at gtkaboutdialog.c line 2362
  • #6 license_button_clicked
    at gtkaboutdialog.c line 684
  • #0 g_log
    at gmessages.c line 1021
  • #1 g_return_if_fail_warning
    at gmessages.c line 1034
  • #2 gtk_text_buffer_apply_tag
    at gtktextbuffer.c line 2626
  • #3 text_buffer_new
    at gtkaboutdialog.c line 2067
  • #4 populate_license_page
    at gtkaboutdialog.c line 2348
  • #5 display_license_page
    at gtkaboutdialog.c line 2362
  • #6 license_button_clicked
    at gtkaboutdialog.c line 684

   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
Comment 1 Kjell Ahlstedt 2013-05-28 07:29:07 UTC
Created attachment 245430 [details]
testaboutdialog.c
Comment 2 Kjell Ahlstedt 2013-05-28 14:35:13 UTC
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.
Comment 3 Kjell Ahlstedt 2013-06-02 17:07:27 UTC
Created attachment 245865 [details] [review]
patch: GtkAboutDialog: Fix the font scale in the license box.
Comment 4 Kjell Ahlstedt 2013-06-18 07:50:33 UTC
Can I push the patch?
Comment 5 Kjell Ahlstedt 2013-07-07 17:28:24 UTC
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.