Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

I can see exported menus with D-Feet but Unity doesn't display them... Any Idea, additional documentation or code examples?

This is my code:

GMenu *menu = g_menu_new ();
g_menu_append (menu, "Add", "app.add");
g_menu_append (menu, "Del", "app.del");
g_menu_append (menu, "Quit", "app.quit");

GDBusConnection *bus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL);

guint id = g_dbus_connection_export_menu_model (bus, "/org/gtk/example/menus/AppMenu", G_MENU_MODEL (menubar), NULL);

g_object_unref (menu);

I won't use gtk_application_set_app_menu or libdbusmenu.

share|improve this question

1 Answer 1

Missed some XSettings

GdkWindow *gdkwindow = gtk_widget_get_window (GTK_WIDGET (window));
gdk_x11_window_set_utf8_property (gdkwindow, "_GTK_UNIQUE_BUS_NAME", "org.gtk.example");
gdk_x11_window_set_utf8_property (gdkwindow, "_GTK_APP_MENU_OBJECT_PATH", "/org/gtk/example/menus/appmenu");
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.