I've actually looked at the entire stack from unity-panel-service to libgtk and I can't notice any difference in how a standard menubar is initalized, compared to an one using gtkbuilder.
The only difference is that the initialization of the gtk accelerators for a gtkbuilder menubar is done in _gtk_widget_buildable_finish_accelerator() but that performs the exactly same operations that we should have done by hand.
So, I've added some debug bits to dbusmenu, indicator-appmenu, appmenu-gtk and libgtk... If I run the sample code linked above, I get this output: http://paste.ubuntu.com/707116/
As you can see gtk correctly initializes the accelerators and libdbusmenu-gtk exports them correclty.
On the other side, and so in unity-panel-service the output of my debug session is http://paste.ubuntu.com/707114/ and it actually shows how correctly the application registers its accelerators as dbusmenuitems.
So I can't find what's exactly going on here. For sure the isse with a gtkbuilder-based application accelerators stop to work when the gtk-menubar his hidden. In fact if you edit the gtk's file gtkmenubar.c and you add at the end of local_notify something like:
GTK_WIDGET_CLASS (gtk_menu_bar_parent_class)->show (GTK_WIDGET (widget));
to make it always show the menubar (also if collapsed), then the accelerators will work also in a gtkbuilder application, but this is maybe quite obvious.
I could also attach the same logs (maybe improved, including the called function name) for a working application, but they don't seem to change compared to the above session.
I've actually looked at the entire stack from unity-panel-service to libgtk and I can't notice any difference in how a standard menubar is initalized, compared to an one using gtkbuilder.
The only difference is that the initialization of the gtk accelerators for a gtkbuilder menubar is done in _gtk_widget_ buildable_ finish_ accelerator( ) but that performs the exactly same operations that we should have done by hand.
So, I've added some debug bits to dbusmenu, indicator-appmenu, appmenu-gtk and libgtk... If I run the sample code linked above, I get this output: http:// paste.ubuntu. com/707116/
As you can see gtk correctly initializes the accelerators and libdbusmenu-gtk exports them correclty.
On the other side, and so in unity-panel-service the output of my debug session is http:// paste.ubuntu. com/707114/ and it actually shows how correctly the application registers its accelerators as dbusmenuitems.
So I can't find what's exactly going on here. For sure the isse with a gtkbuilder-based application accelerators stop to work when the gtk-menubar his hidden. In fact if you edit the gtk's file gtkmenubar.c and you add at the end of local_notify something like: bar_parent_ class)- >show (GTK_WIDGET (widget));
GTK_WIDGET_CLASS (gtk_menu_
to make it always show the menubar (also if collapsed), then the accelerators will work also in a gtkbuilder application, but this is maybe quite obvious.
I could also attach the same logs (maybe improved, including the called function name) for a working application, but they don't seem to change compared to the above session.