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 777547 - Notebook arrow icon wrong color after closing final tab
Notebook arrow icon wrong color after closing final tab
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkNotebook
3.22.x
Other Linux
: Normal minor
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2017-01-21 02:18 UTC by Michael Catanzaro
Modified: 2017-02-04 18:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
notebook: redraw arrows after closing a tab (744 bytes, patch)
2017-01-21 02:21 UTC, Michael Catanzaro
none Details | Review
notebook: redraw arrows after closing a tab (845 bytes, patch)
2017-01-31 18:04 UTC, Michael Catanzaro
committed Details | Review

Description Michael Catanzaro 2017-01-21 02:18:09 UTC
This is a follow-up to bug #770332. After closing the rightmost tab in a GtkNotebook, the tab arrow sometimes darkens to indicate that the notebook can be scrolled to the right, even though the notebook is displaying the final tab and cannot be scrolled further.
Comment 1 Michael Catanzaro 2017-01-21 02:21:18 UTC
Created attachment 343930 [details] [review]
notebook: redraw arrows after closing a tab
Comment 2 Matthias Clasen 2017-01-24 08:54:32 UTC
Review of attachment 343930 [details] [review]:

Ok
Comment 3 Michael Catanzaro 2017-01-24 14:33:12 UTC
Attachment 343930 [details] pushed as 8caaba8 - notebook: redraw arrows after closing a tab
Comment 4 Timm Bäder 2017-01-27 11:29:56 UTC
This patch makes the widget-factory crash on close (in master at least):

  • #0 gtk_notebook_search_page.lto_priv.5516
    at gtknotebook.c line 5051
  • #1 update_arrow_state
    at gtknotebook.c line 3294
  • #2 gtk_notebook_redraw_arrows.lto_priv.5514
    at gtknotebook.c line 4746
  • #3 gtk_notebook_real_remove
    at gtknotebook.c line 4954
  • #4 gtk_notebook_remove.lto_priv.5295
    at gtknotebook.c line 4082
  • #5 g_cclosure_marshal_VOID__OBJECTv
    at /home/baedert/Source/gnome/glib/gobject/gmarshal.c line 2102
  • #6 g_type_class_meta_marshalv
    at /home/baedert/Source/gnome/glib/gobject/gclosure.c line 1024
  • #7 _g_closure_invoke_va
    at /home/baedert/Source/gnome/glib/gobject/gclosure.c line 867
  • #8 g_signal_emit_valist
    at /home/baedert/Source/gnome/glib/gobject/gsignal.c line 3300
  • #9 g_signal_emit
    at /home/baedert/Source/gnome/glib/gobject/gsignal.c line 3447
  • #10 gtk_container_remove
    at gtkcontainer.c line 1693
  • #11 gtk_widget_dispose.lto_priv.2517
    at gtkwidget.c line 10358
  • #12 gtk_box_dispose
    at gtkbox.c line 223
  • #13 g_object_run_dispose
    at /home/baedert/Source/gnome/glib/gobject/gobject.c line 1084
  • #14 gtk_widget_destroy
    at gtkwidget.c line 4153
  • #15 gtk_notebook_forall.lto_priv.5296
    at gtknotebook.c line 4430
  • #16 gtk_container_foreach
    at gtkcontainer.c line 1962
  • #17 gtk_container_destroy
    at gtkcontainer.c line 1618
  • #18 gtk_notebook_destroy
    at gtknotebook.c line 1732
  • #19 g_cclosure_marshal_VOID__VOID

Comment 5 Timm Bäder 2017-01-27 11:31:29 UTC
meh the last part of my message was swallowed by that trace, but one can also see that as an invalid read in valgrind:

==4809== 
==4809== Invalid read of size 8
==4809==    at 0x51446BC: gtk_notebook_search_page.lto_priv.5516 (gtknotebook.c:5020)
==4809==    by 0x5140585: update_arrow_state (gtknotebook.c:3294)
==4809==    by 0x5143B1E: gtk_notebook_redraw_arrows.lto_priv.5514 (gtknotebook.c:4746)
==4809==    by 0x514434D: gtk_notebook_real_remove (gtknotebook.c:4954)
==4809==    by 0x5142443: gtk_notebook_remove.lto_priv.5295 (gtknotebook.c:4082)
==4809==    by 0xA04EE8E: g_cclosure_marshal_VOID__OBJECTv (gmarshal.c:2102)
==4809==    by 0xA05313D: g_type_class_meta_marshalv (gclosure.c:1024)
==4809==    by 0xA052D00: _g_closure_invoke_va (gclosure.c:867)
==4809==    by 0xA036DAC: g_signal_emit_valist (gsignal.c:3300)
==4809==    by 0xA037F2C: g_signal_emit (gsignal.c:3447)
==4809==    by 0x52AD069: gtk_container_remove (gtkcontainer.c:1693)
==4809==    by 0x4FA7701: gtk_widget_dispose.lto_priv.2517 (gtkwidget.c:10358)
==4809==    by 0x532C355: gtk_box_dispose (gtkbox.c:223)
==4809==    by 0xA049BF2: g_object_run_dispose (gobject.c:1084)
==4809==    by 0x4FEEA72: gtk_widget_destroy (gtkwidget.c:4153)
==4809==    by 0x5143013: gtk_notebook_forall.lto_priv.5296 (gtknotebook.c:4430)
==4809==    by 0x52AD7E6: gtk_container_foreach (gtkcontainer.c:1962)
==4809==    by 0x52ACCCE: gtk_container_destroy (gtkcontainer.c:1618)
==4809==    by 0x5191FCB: gtk_notebook_destroy (gtknotebook.c:1732)
==4809==    by 0xA051BCA: g_cclosure_marshal_VOID(intXX_t &&) volatile (gmarshal.c:875)
==4809==    by 0xA0530BC: g_type_class_meta_marshal (gclosure.c:997)
==4809==    by 0xA052A68: g_closure_invoke (gclosure.c:804)
==4809==    by 0xA03446D: signal_emit_unlocked_R.lto_priv.369 (gsignal.c:3751)
==4809==    by 0xA0379ED: g_signal_emit_valist (gsignal.c:3391)
==4809==    by 0xA037F2C: g_signal_emit (gsignal.c:3447)
==4809==    by 0x4FA77A2: gtk_widget_dispose.lto_priv.2517 (gtkwidget.c:10371)
==4809==    by 0xA049BF2: g_object_run_dispose (gobject.c:1084)
==4809==    by 0x4FEEA72: gtk_widget_destroy (gtkwidget.c:4153)
==4809==    by 0x533157F: gtk_box_forall (gtkbox.c:2500)
==4809==    by 0x52AD7E6: gtk_container_foreach (gtkcontainer.c:1962)
==4809==    by 0x52ACCCE: gtk_container_destroy (gtkcontainer.c:1618)
==4809==    by 0xA051BCA: g_cclosure_marshal_VOID(intXX_t &&) volatile (gmarshal.c:875)
==4809==    by 0xA0530BC: g_type_class_meta_marshal (gclosure.c:997)
==4809==    by 0xA052A68: g_closure_invoke (gclosure.c:804)
==4809==    by 0xA03446D: signal_emit_unlocked_R.lto_priv.369 (gsignal.c:3751)
==4809==    by 0xA0379ED: g_signal_emit_valist (gsignal.c:3391)
==4809==    by 0xA037F2C: g_signal_emit (gsignal.c:3447)
==4809==    by 0x4FA77A2: gtk_widget_dispose.lto_priv.2517 (gtkwidget.c:10371)
==4809==    by 0x532C355: gtk_box_dispose (gtkbox.c:223)
==4809==    by 0xA049BF2: g_object_run_dispose (gobject.c:1084)
==4809==    by 0x4FEEA72: gtk_widget_destroy (gtkwidget.c:4153)
==4809==    by 0x533157F: gtk_box_forall (gtkbox.c:2500)
==4809==    by 0x52AD7E6: gtk_container_foreach (gtkcontainer.c:1962)
==4809==    by 0x52ACCCE: gtk_container_destroy (gtkcontainer.c:1618)
==4809==    by 0xA051BCA: g_cclosure_marshal_VOID(intXX_t &&) volatile (gmarshal.c:875)
==4809==    by 0xA0530BC: g_type_class_meta_marshal (gclosure.c:997)
==4809==    by 0xA052A68: g_closure_invoke (gclosure.c:804)
==4809==    by 0xA03446D: signal_emit_unlocked_R.lto_priv.369 (gsignal.c:3751)
==4809==    by 0xA0379ED: g_signal_emit_valist (gsignal.c:3391)
==4809==    by 0xA037F2C: g_signal_emit (gsignal.c:3447)
==4809==  Address 0x19220d00 is 0 bytes inside a block of size 24 free'd
==4809==    at 0x4C2BD3A: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4809==    by 0xA4E5D95: g_free (gmem.c:189)
==4809==    by 0xA4CCD39: g_slice_free_chain_with_offset (gslice.c:1232)
==4809==    by 0xA4F3CD2: g_list_free (glist.c:182)
==4809==    by 0x514427F: gtk_notebook_real_remove (gtknotebook.c:4937)
==4809==    by 0x5142443: gtk_notebook_remove.lto_priv.5295 (gtknotebook.c:4082)
==4809==    by 0xA04EE8E: g_cclosure_marshal_VOID__OBJECTv (gmarshal.c:2102)
==4809==    by 0xA05313D: g_type_class_meta_marshalv (gclosure.c:1024)
==4809==    by 0xA052D00: _g_closure_invoke_va (gclosure.c:867)
==4809==    by 0xA036DAC: g_signal_emit_valist (gsignal.c:3300)
==4809==    by 0xA037F2C: g_signal_emit (gsignal.c:3447)
==4809==    by 0x52AD069: gtk_container_remove (gtkcontainer.c:1693)
==4809==    by 0x4FA7701: gtk_widget_dispose.lto_priv.2517 (gtkwidget.c:10358)
==4809==    by 0x532C355: gtk_box_dispose (gtkbox.c:223)
==4809==    by 0xA049BF2: g_object_run_dispose (gobject.c:1084)
==4809==    by 0x4FEEA72: gtk_widget_destroy (gtkwidget.c:4153)
==4809==    by 0x5143013: gtk_notebook_forall.lto_priv.5296 (gtknotebook.c:4430)
==4809==    by 0x52AD7E6: gtk_container_foreach (gtkcontainer.c:1962)
==4809==    by 0x52ACCCE: gtk_container_destroy (gtkcontainer.c:1618)
==4809==    by 0x5191FCB: gtk_notebook_destroy (gtknotebook.c:1732)
==4809==    by 0xA051BCA: g_cclosure_marshal_VOID(intXX_t &&) volatile (gmarshal.c:875)
==4809==    by 0xA0530BC: g_type_class_meta_marshal (gclosure.c:997)
==4809==    by 0xA052A68: g_closure_invoke (gclosure.c:804)
==4809==    by 0xA03446D: signal_emit_unlocked_R.lto_priv.369 (gsignal.c:3751)
==4809==    by 0xA0379ED: g_signal_emit_valist (gsignal.c:3391)
==4809==    by 0xA037F2C: g_signal_emit (gsignal.c:3447)
==4809==    by 0x4FA77A2: gtk_widget_dispose.lto_priv.2517 (gtkwidget.c:10371)
==4809==    by 0xA049BF2: g_object_run_dispose (gobject.c:1084)
==4809==    by 0x4FEEA72: gtk_widget_destroy (gtkwidget.c:4153)
==4809==    by 0x533157F: gtk_box_forall (gtkbox.c:2500)
==4809==    by 0x52AD7E6: gtk_container_foreach (gtkcontainer.c:1962)
==4809==    by 0x52ACCCE: gtk_container_destroy (gtkcontainer.c:1618)
==4809==    by 0xA051BCA: g_cclosure_marshal_VOID(intXX_t &&) volatile (gmarshal.c:875)
==4809==    by 0xA0530BC: g_type_class_meta_marshal (gclosure.c:997)
==4809==    by 0xA052A68: g_closure_invoke (gclosure.c:804)
==4809==    by 0xA03446D: signal_emit_unlocked_R.lto_priv.369 (gsignal.c:3751)
==4809==    by 0xA0379ED: g_signal_emit_valist (gsignal.c:3391)
==4809==    by 0xA037F2C: g_signal_emit (gsignal.c:3447)
==4809==    by 0x4FA77A2: gtk_widget_dispose.lto_priv.2517 (gtkwidget.c:10371)
==4809==    by 0x532C355: gtk_box_dispose (gtkbox.c:223)
==4809==    by 0xA049BF2: g_object_run_dispose (gobject.c:1084)
==4809==    by 0x4FEEA72: gtk_widget_destroy (gtkwidget.c:4153)
==4809==    by 0x533157F: gtk_box_forall (gtkbox.c:2500)
==4809==    by 0x52AD7E6: gtk_container_foreach (gtkcontainer.c:1962)
==4809==    by 0x52ACCCE: gtk_container_destroy (gtkcontainer.c:1618)
==4809==    by 0xA051BCA: g_cclosure_marshal_VOID(intXX_t &&) volatile (gmarshal.c:875)
==4809==    by 0xA0530BC: g_type_class_meta_marshal (gclosure.c:997)
==4809==    by 0xA052A68: g_closure_invoke (gclosure.c:804)
==4809==    by 0xA03446D: signal_emit_unlocked_R.lto_priv.369 (gsignal.c:3751)
==4809==    by 0xA0379ED: g_signal_emit_valist (gsignal.c:3391)
==4809==  Block was alloc'd at
==4809==    at 0x4C2AB8D: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4809==    by 0xA4E5C2C: g_malloc (gmem.c:94)
==4809==    by 0xA4CC8B0: g_slice_alloc (gslice.c:1025)
==4809==    by 0xA4F3DBF: g_list_prepend (glist.c:311)
==4809==    by 0xA4F3E78: g_list_insert (glist.c:351)
==4809==    by 0x5143617: gtk_notebook_real_insert_page.lto_priv.5302 (gtknotebook.c:4621)
==4809==    by 0x5147DAC: gtk_notebook_insert_page_menu (gtknotebook.c:6467)
==4809==    by 0x51471DF: gtk_notebook_append_page (gtknotebook.c:6279)
==4809==    by 0x5191075: gtk_notebook_buildable_add_child (gtknotebook.c:1286)
==4809==    by 0x5333EE7: gtk_buildable_add_child (gtkbuildable.c:136)
==4809==    by 0x53368CD: _gtk_builder_add (gtkbuilder.c:868)
==4809==    by 0x52F4873: parse_custom (gtkbuilderparser.c:903)
==4809==    by 0x52F4D7E: start_element.lto_priv.9740 (gtkbuilderparser.c:996)
==4809==    by 0xA4EC630: emit_start_element.lto_priv.974 (gmarkup.c:1041)
==4809==    by 0xA4E363B: g_markup_parse_context_parse (gmarkup.c:1388)
==4809==    by 0x52F58CC: _gtk_builder_parser_parse_buffer (gtkbuilderparser.c:1274)
==4809==    by 0x533750A: gtk_builder_add_from_resource (gtkbuilder.c:1230)
==4809==    by 0x533A5EC: gtk_builder_new_from_resource (gtkbuilder.c:2585)
==4809==    by 0x406AFA: activate.lto_priv.0 (widget-factory.c:1667)
==4809==    by 0xA051BCA: g_cclosure_marshal_VOID(intXX_t &&) volatile (gmarshal.c:875)
==4809==    by 0xA052A68: g_closure_invoke (gclosure.c:804)
==4809==    by 0xA033FCB: signal_emit_unlocked_R.lto_priv.369 (gsignal.c:3635)
==4809==    by 0xA0379ED: g_signal_emit_valist (gsignal.c:3391)
==4809==    by 0xA037F2C: g_signal_emit (gsignal.c:3447)
==4809==    by 0x94D254B: g_application_activate (gapplication.c:2148)
==4809==    by 0x94E0683: g_application_real_local_command_line.lto_priv.1719 (gapplication.c:1045)
==4809==    by 0x535AFE7: gtk_application_local_command_line.lto_priv.8507 (gtkapplication.c:330)
==4809==    by 0x94D28DB: g_application_run (gapplication.c:2350)
==4809==    by 0x4068CD: main (widget-factory.c:1956)
Comment 6 Michael Catanzaro 2017-01-28 21:51:57 UTC
(In reply to Timm Bäder from comment #4)
> This patch makes the widget-factory crash on close (in master at least):

I can't reproduce; it works for me. Are you doing something special before closing widget-factory?

I guess we should not redraw the arrows if the notebook is being destroyed. Not sure the right way to detect that....
Comment 7 Timm Bäder 2017-01-29 07:24:31 UTC
(In reply to Michael Catanzaro from comment #6)
> (In reply to Timm Bäder from comment #4)
> > This patch makes the widget-factory crash on close (in master at least):
> 
> I can't reproduce; it works for me. Are you doing something special before
> closing widget-factory?

It happens after the window already disappears and not always, it's just an invalid read. valgrind always shows it though.
Comment 8 Daniel Boles 2017-01-31 12:33:20 UTC
(In reply to Michael Catanzaro from comment #6)
> I guess we should not redraw the arrows if the notebook is being destroyed.
> Not sure the right way to detect that....

gtk_notebook_real_remove() already does several things conditional on a gboolean for whether the widget is bring destroyed, so it seems the quick fix would be to use that. I dunno whether the fact it already does that is a good thing, though!
Comment 9 Michael Catanzaro 2017-01-31 17:56:13 UTC
I didn't know about gtk_widget_in_destruction()! That looks useful.
Comment 10 Michael Catanzaro 2017-01-31 18:04:13 UTC
I can't reproduce the valgrind warnings even in master, but I guess this patch would fix it. Timm, does it look OK to commit?
Comment 11 Michael Catanzaro 2017-01-31 18:04:35 UTC
Created attachment 344663 [details] [review]
notebook: redraw arrows after closing a tab

Thanks to Daniel Boles for helping with a crash in an earlier version of
this patch.
Comment 12 Timm Bäder 2017-02-04 05:41:08 UTC
> Timm, does it look OK to commit?

I didn't check that it fixes the actual bug, but it doesn't make the widget-factory crash anymore and valgrind doesn't complain so yes. Thanks!
Comment 13 Michael Catanzaro 2017-02-04 18:56:48 UTC
Attachment 344663 [details] pushed as 644c2d9 - notebook: redraw arrows after closing a tab