After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 665950 - Support different menubar models per window
Support different menubar models per window
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Class: GtkApplication
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks: 665312
 
 
Reported: 2011-12-11 16:30 UTC by Matthias Clasen
Modified: 2014-08-03 18:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
preliminary patch (16.80 KB, patch)
2011-12-12 23:51 UTC, Matthias Clasen
none Details | Review
tentative gtk patch to go with this (5.37 KB, patch)
2011-12-13 02:48 UTC, Matthias Clasen
none Details | Review

Description Matthias Clasen 2011-12-11 16:30:00 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)
Comment 1 Allison Karlitskaya (desrt) 2011-12-11 16:42:34 UTC
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.
Comment 2 Matthias Clasen 2011-12-12 23:51:31 UTC
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.
Comment 3 Allison Karlitskaya (desrt) 2011-12-13 01:58:29 UTC
I don't like how this turns appmenu and menubar merely into two strings floating in a free namespace.  We should keep more structure.
Comment 4 Matthias Clasen 2011-12-13 02:48:24 UTC
Created attachment 203314 [details] [review]
tentative gtk patch to go with this
Comment 5 Matthias Clasen 2011-12-13 02:50:10 UTC
(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.
Comment 6 Matthias Clasen 2014-08-03 18:32:09 UTC
I think this has been obsoleted by recent menu-from-resource work