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 658111 - gtk_label_set_pattern() is reset by a call to gtk_box_pack_start()
gtk_label_set_pattern() is reset by a call to gtk_box_pack_start()
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkLabel
3.1.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 676550 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-09-03 08:18 UTC by Kjell Ahlstedt
Modified: 2017-08-06 18:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GtkLabel: make patterns work a little better (1.54 KB, patch)
2011-09-04 04:02 UTC, Matthias Clasen
committed Details | Review

Description Kjell Ahlstedt 2011-09-03 08:18:25 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
  • #0 gtk_label_recalculate
    at gtklabel.c line 2096
  • #1 label_shortcut_setting_apply
    at gtklabel.c line 1764
  • #2 g_cclosure_marshal_VOID__OBJECT
    at gmarshal.c line 644
  • #3 g_type_class_meta_marshal
    at gclosure.c line 885
  • #4 g_closure_invoke
    at gclosure.c line 774
  • #5 signal_emit_unlocked_R
    at gsignal.c line 3310
  • #6 g_signal_emit_valist
    at gsignal.c line 3003
  • #7 g_signal_emit
    at gsignal.c line 3060
  • #8 do_screen_change
    at gtkwidget.c line 8613
  • #9 gtk_widget_propagate_hierarchy_changed_recurse
    at gtkwidget.c line 8633
  • #10 gtk_frame_forall
    at gtkframe.c line 374
  • #11 gtk_container_forall
    at gtkcontainer.c line 2012
  • #12 gtk_widget_propagate_hierarchy_changed_recurse
    at gtkwidget.c line 8636
  • #13 _gtk_widget_propagate_hierarchy_changed
    at gtkwidget.c line 8674
  • #14 gtk_widget_set_parent
    at gtkwidget.c line 7797
  • #15 gtk_box_pack
    at gtkbox.c line 980
  • #16 create_labels
    at testgtk.c line 2021
  • #17 g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 85
  • #18 g_closure_invoke
    at gclosure.c line 774
  • #19 signal_emit_unlocked_R
    at gsignal.c line 3272
  • #20 g_signal_emit_valist
    at gsignal.c line 3003
  • #21 g_signal_emit
    at gsignal.c line 3060
  • #22 gtk_button_clicked
    at gtkbutton.c line 1196
  • #23 gtk_real_button_released
    at gtkbutton.c line 1825
  • #24 g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 85
  • #25 g_type_class_meta_marshal
    at gclosure.c line 885
  • #26 g_closure_invoke
    at gclosure.c line 774
  • #27 signal_emit_unlocked_R
    at gsignal.c line 3202
  • #28 g_signal_emit_valist
    at gsignal.c line 3003
  • #29 g_signal_emit
    at gsignal.c line 3060
  • #30 gtk_button_released
    at gtkbutton.c line 1182
  • #31 gtk_button_button_release
    at gtkbutton.c line 1717
  • #32 _gtk_marshal_BOOLEAN__BOXED
    at gtkmarshalers.c line 85
  • #33 g_type_class_meta_marshal
    at gclosure.c line 885
  • #34 g_closure_invoke
    at gclosure.c line 774
  • #35 signal_emit_unlocked_R
    at gsignal.c line 3310
  • #36 g_signal_emit_valist
    at gsignal.c line 3013
  • #37 g_signal_emit
    at gsignal.c line 3060
  • #38 gtk_widget_event_internal
    at gtkwidget.c line 6131
  • #39 gtk_propagate_event
    at gtkmain.c line 2614
  • #40 gtk_main_do_event
    at gtkmain.c line 1889
  • #41 _gdk_event_emit
    at gdkevents.c line 71
  • #42 gdk_event_source_dispatch
    at gdkeventsource.c line 360
  • #43 g_main_dispatch
    at gmain.c line 2441
  • #44 g_main_context_dispatch
    at gmain.c line 3011
  • #45 g_main_context_iterate
    at gmain.c line 3089
  • #46 g_main_loop_run
    at gmain.c line 3297
  • #47 gtk_main
    at gtkmain.c line 1362
  • #48 main
    at testgtk.c line 10367
  • #0 gtk_label_recalculate
    at gtklabel.c line 2096
  • #1 label_shortcut_setting_apply
    at gtklabel.c line 1764
  • #2 g_cclosure_marshal_VOID__OBJECT
    at gmarshal.c line 644
  • #3 g_type_class_meta_marshal
    at gclosure.c line 885
  • #4 g_closure_invoke
    at gclosure.c line 774
  • #5 signal_emit_unlocked_R
    at gsignal.c line 3310
  • #6 g_signal_emit_valist
    at gsignal.c line 3003
  • #7 g_signal_emit
    at gsignal.c line 3060
  • #8 do_screen_change
    at gtkwidget.c line 8613
  • #9 gtk_widget_propagate_hierarchy_changed_recurse
    at gtkwidget.c line 8633
  • #10 gtk_frame_forall
    at gtkframe.c line 377
  • #11 gtk_container_forall
    at gtkcontainer.c line 2012
  • #12 gtk_widget_propagate_hierarchy_changed_recurse
    at gtkwidget.c line 8636
  • #13 _gtk_widget_propagate_hierarchy_changed
    at gtkwidget.c line 8674
  • #14 gtk_widget_set_parent
    at gtkwidget.c line 7797
  • #15 gtk_box_pack
    at gtkbox.c line 980
  • #16 create_labels
    at testgtk.c line 2021
  • #17 g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 85
  • #18 g_closure_invoke
    at gclosure.c line 774
  • #19 signal_emit_unlocked_R
    at gsignal.c line 3272
  • #20 g_signal_emit_valist
    at gsignal.c line 3003
  • #21 g_signal_emit
    at gsignal.c line 3060
  • #22 gtk_button_clicked
    at gtkbutton.c line 1196
  • #23 gtk_real_button_released
    at gtkbutton.c line 1825
  • #24 g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 85
  • #25 g_type_class_meta_marshal
    at gclosure.c line 885
  • #26 g_closure_invoke
    at gclosure.c line 774
  • #27 signal_emit_unlocked_R
    at gsignal.c line 3202
  • #28 g_signal_emit_valist
    at gsignal.c line 3003
  • #29 g_signal_emit
    at gsignal.c line 3060
  • #30 gtk_button_released
    at gtkbutton.c line 1182
  • #31 gtk_button_button_release
    at gtkbutton.c line 1717
  • #32 _gtk_marshal_BOOLEAN__BOXED
    at gtkmarshalers.c line 85
  • #33 g_type_class_meta_marshal
    at gclosure.c line 885
  • #34 g_closure_invoke
    at gclosure.c line 774
  • #35 signal_emit_unlocked_R
    at gsignal.c line 3310
  • #36 g_signal_emit_valist
    at gsignal.c line 3013
  • #37 g_signal_emit
    at gsignal.c line 3060
  • #38 gtk_widget_event_internal
    at gtkwidget.c line 6131
  • #39 gtk_propagate_event
    at gtkmain.c line 2614
  • #40 gtk_main_do_event
    at gtkmain.c line 1889
  • #41 _gdk_event_emit
    at gdkevents.c line 71
  • #42 gdk_event_source_dispatch
    at gdkeventsource.c line 360
  • #43 g_main_dispatch
    at gmain.c line 2441
  • #44 g_main_context_dispatch
    at gmain.c line 3011
  • #45 g_main_context_iterate
    at gmain.c line 3089
  • #46 g_main_loop_run
    at gmain.c line 3297
  • #47 gtk_main
    at gtkmain.c line 1362
  • #48 main
    at testgtk.c line 10367

   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().
Comment 1 Matthias Clasen 2011-09-04 04:02:01 UTC
The following fix has been pushed:
dc898e3 GtkLabel: make patterns work a little better
Comment 2 Matthias Clasen 2011-09-04 04:02:08 UTC
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.
Comment 3 Daniel Boles 2017-08-06 18:05:53 UTC
*** Bug 676550 has been marked as a duplicate of this bug. ***