1

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.

https://live.gnome.org/GTK%2B/GApplication-dbus-apis

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");

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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