GNOME Bugzilla – Bug 515017
Crash in my code
Last modified: 2008-02-08 00:30:32 UTC
Steps to reproduce: 1. download the attached source file 2. compile it (gcc -o test main.c `pkg-config --cflags --libs gtk+-2.0`) 3. execute it Stack trace:
+ Trace 188435
Other information: If you change "GameResume" into "GamePause" (line 43) everything works.
Created attachment 104648 [details] Testcase
Same crash here ( ubuntu 7.04 and ubuntu 8.04 ) Crash occure with any actions ( tested with "GamePause","GameStop" and "GameNew1Player")
<popup name='game_menu'> is missing a GtkAction for the popup menu.
According to the DTD, it is not required: http://library.gnome.org/devel/gtk/stable/GtkUIManager.html#XML-UI If you think the DTD is wrong, then the parser in GtkUIManager is wrong too: * "<menuitem />" will give this warning: (monkey-bubble:16314): Gtk-WARNING **: menuitem: missing action (null) * "<popup />" doesn't give any warning: So either the DTD _and_ the parsing code are both wrong. I actually don't think that a popup is an "action" as well as I don't think of menubars as "actions". And, menubars also never get actions assigned in the example code from the documentation. More pointers: No action for a menubar: http://library.gnome.org/devel/gtk/stable/GtkUIManager.html#id3477610 No actions for a menubar nor for a toolbar: http://svn.gnome.org/viewvc/gtk%2B/trunk/demos/gtk-demo/ui_manager.c?annotate=16908 (lines 106ff)
If the dtd and the code disagree, the dtd is wrong.
Created attachment 104675 [details] [review] Proposed Patch May I commit this one?
Please commit to both branches, thanks
Committed to trunk and gtk-2-12 2008-02-08 Sven Herzberg <sven@imendio.com> >-------Adjust the code to match the documentation, examples, "common sense" >-------and existing applications. >-------* gtk/gtkaction.c: (_gtk_action_sync_menu_visible): take into account >-------that a GtkMenu for a <popup> element doesn't have to have a GtkAction >-------assigned