GNOME Bugzilla – Bug 658111
gtk_label_set_pattern() is reset by a call to gtk_box_pack_start()
Last modified: 2017-08-06 18:05:53 UTC
An underline pattern that has been set by gtk_label_set_pattern() is removed by a call to gtk_box_pack_start(). This is because that call emits the screen-changed signal, which in turn triggers a call to gtk_label_recalculate(). See the following backtraces. Breakpoint 2, gtk_label_recalculate (label=0x8250b10) at gtklabel.c:2096 2096 GtkLabelPrivate *priv = label->priv; (gdb) bt
+ Trace 228325
Steps to reproduce: Start the test program gtk+/tests/testgtk. Click the "labels" button. Actual results: No part of the text is underlined in the frame "Underlined label". Expected results: Some parts of the text shall be underlined in the frame "Underlined label". Build date and platform: Ubuntu 11.04, source code of gtk+, glib, etc. built with jhbuild on 2011-09-01--02 Additional information: If the call to gtk_label_set_pattern() in testgtk.c is moved after gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); the text is underlined as intended. This seems to be the same bug as reported in bug 452861, which was fixed 2007-07-09. Has that bug reappeared as a side-effect of some modification of gtklabel.c? The pattern_set flag that was added in the fix is not tested in gtk_label_recalculate().
The following fix has been pushed: dc898e3 GtkLabel: make patterns work a little better
Created attachment 195608 [details] [review] GtkLabel: make patterns work a little better When a pattern has been set, we must not throw away the attributes that contain it.
*** Bug 676550 has been marked as a duplicate of this bug. ***