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 624707 - critical warnings when showing gnome-terminal menus on gtk master
critical warnings when showing gnome-terminal menus on gtk master
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkMenu
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2010-07-19 07:44 UTC by Christian Persch
Modified: 2010-07-22 15:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Check if a menuitems child actually exists before using it (966 bytes, patch)
2010-07-21 21:17 UTC, Felix Riemann
accepted-commit_now Details | Review
Check if a childs actually exists before using it (3.74 KB, patch)
2010-07-22 14:45 UTC, Javier Jardón (IRC: jjardon)
committed Details | Review

Description Christian Persch 2010-07-19 07:44:14 UTC
(This is with gtk 3 master as of commit a9e96106f9a54825e5a875fd3806ac3b1cd96150.)

Steps to repro: build g-t (and vte) from master, start "./gnome-terminal --disable-factory --show-menubar", then either 
* right-click, or press the menu key, to activate the context menu
* click on one of the toplevel menus, or press one of its mnemonics 

Result: lots of critical warnings on console:

Gtk-CRITICAL **: gtk_widget_get_visible: assertion `GTK_IS_WIDGET (widget)' failed

  • #0 g_log
    at gmessages.c line 567
  • #1 g_return_if_fail_warning
  • #2 gtk_widget_get_visible
    at gtkwidget.c line 5931
  • #3 gtk_menu_item_size_request
    at gtkmenuitem.c line 976
  • #4 g_cclosure_marshal_VOID__BOXED
    at gmarshal.c line 568
  • #5 g_type_class_meta_marshal
    at gclosure.c line 877
  • #6 g_closure_invoke
    at gclosure.c line 766
  • #7 signal_emit_unlocked_R
    at gsignal.c line 3182
  • #8 g_signal_emit_valist
    at gsignal.c line 2983
  • #9 g_signal_emit_by_name
    at gsignal.c line 3077
  • #10 do_size_request
    at gtksizerequest.c line 214
  • #11 compute_size_for_orientation
    at gtksizerequest.c line 269
  • #12 gtk_size_request_get_width
    at gtksizerequest.c line 403
  • #13 gtk_size_request_get_size
    at gtksizerequest.c line 501
  • #14 gtk_widget_size_request
    at gtkwidget.c line 3858
  • #15 gtk_menu_size_request
    at gtkmenu.c line 2586

Comment 1 Felix Riemann 2010-07-21 21:17:30 UTC
Created attachment 166332 [details] [review]
Check if a menuitems child actually exists before using it

Check seems to have gone lost during GtkBin sealing in commit 4427760b.
Fixes critical warnings when opening menus containing separators
for the first time.

https://bugzilla.gnome.org/show_bug.cgi?id=624707
Comment 2 Felix Riemann 2010-07-21 21:18:43 UTC
I haven't tested it with gnome-terminal but with a gtk3-patched eog where it successfully fixed these critical warnings.
Comment 3 Emmanuele Bassi (:ebassi) 2010-07-22 09:13:01 UTC
Review of attachment 166332 [details] [review]:

looks good. please, commit.
Comment 4 Javier Jardón (IRC: jjardon) 2010-07-22 14:45:43 UTC
Created attachment 166394 [details] [review]
Check if a childs actually exists before using it

More complete patch
Comment 5 Emmanuele Bassi (:ebassi) 2010-07-22 14:48:36 UTC
Review of attachment 166394 [details] [review]:

looks good.

Javier, as a nitpick - can you change all the "if (child && ...)" into "if (child != NULL && ...)"? it fits in the coding style mclasen uses
Comment 6 Javier Jardón (IRC: jjardon) 2010-07-22 15:19:44 UTC
Comment on attachment 166394 [details] [review]
Check if a childs actually exists before using it

Sure, committed with your comments:
commit c1a2ecc369b8419fdd835bb4d45b48982bfb6dab
Comment 7 Javier Jardón (IRC: jjardon) 2010-07-22 15:20:09 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.