GNOME Bugzilla – Bug 665950
Support different menubar models per window
Last modified: 2014-08-03 18:32:09 UTC
The need to allow this has come out clearly in the initial feedback on gmenu on gtk-devel-list. We may want to nudge people toward the simpler one-menubar-per-application setup that is common on OS X, but we can't force this via the API. Possible apis: 1) g_application_add_menubar (app, id, model) gtk_application_window_set_id (win, id) 2) gtk_application_window_set_menubar (app, model)
I prefer 1. One thing that might be interesting to talk about is if we want to support GtkApplication being entirely aware of not just different variants of menubars but of entire window UIs. This way we could tell GtkApplication "here's the GtkBuilder file for a 'composer' window" and then ask later on "make me a composer window" and have it built, including the right menubar.
Created attachment 203308 [details] [review] preliminary patch It changes gapplication to keep track of a list of menu models, each identified by a string id. "AppMenu" and "MenuBar" are used for the app menu and stock menubar. But other ids are possible. The app-menu and menubar properties are gone. This probably misses some change notification, currently.
I don't like how this turns appmenu and menubar merely into two strings floating in a free namespace. We should keep more structure.
Created attachment 203314 [details] [review] tentative gtk patch to go with this
(In reply to comment #3) > I don't like how this turns appmenu and menubar merely into two strings > floating in a free namespace. We should keep more structure. If you look at what gapplication actually does with the menus, there's absolutely no need to special-case these two, though.
I think this has been obsoleted by recent menu-from-resource work