Commit 5e25ba6c authored by Matthias Clasen's avatar Matthias Clasen

Merge branch 'no-app-menu' into 'master'

Drop the app menu

Closes #2731

See merge request !1951
parents 0dc38426 1038b9b8
Pipeline #181812 failed with stages
in 29 minutes and 38 seconds
......@@ -328,19 +328,14 @@ static void
startup (GApplication *app)
{
GtkBuilder *builder;
GMenuModel *appmenu;
GMenuModel *menubar;
G_APPLICATION_CLASS (demo_application_parent_class)->startup (app);
builder = gtk_builder_new ();
gtk_builder_add_from_resource (builder, "/application_demo/menus.ui", NULL);
appmenu = (GMenuModel *)gtk_builder_get_object (builder, "appmenu");
menubar = (GMenuModel *)gtk_builder_get_object (builder, "menubar");
gtk_application_set_app_menu (GTK_APPLICATION (app), appmenu);
gtk_application_set_menubar (GTK_APPLICATION (app), menubar);
gtk_application_set_menubar (GTK_APPLICATION (app),
G_MENU_MODEL (gtk_builder_get_object (builder, "menubar")));
g_object_unref (builder);
}
......@@ -353,6 +348,7 @@ create_window (GApplication *app,
window = (DemoApplicationWindow *)g_object_new (demo_application_window_get_type (),
"application", app,
"show-menubar", TRUE,
NULL);
if (content)
gtk_text_buffer_set_text (window->buffer, content, -1);
......
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<menu id="appmenu">
<section>
<item>
<attribute name="label" translatable="yes">About</attribute>
<attribute name="action">app.about</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Quit</attribute>
<attribute name="action">app.quit</attribute>
<attribute name="accel">&lt;Control&gt;q</attribute>
</item>
</section>
</menu>
</interface>
......@@ -2,7 +2,6 @@
<gresources>
<gresource prefix="/ui">
<file preprocess="xml-stripblanks">main.ui</file>
<file preprocess="xml-stripblanks">appmenu.ui</file>
</gresource>
<gresource prefix="/application_demo">
<file>application.c</file>
......
......@@ -972,23 +972,6 @@ populate_model (GtkTreeModel *model)
}
static void
startup (GApplication *app)
{
GtkBuilder *builder;
GMenuModel *appmenu;
const char *ids[] = { "appmenu", NULL };
builder = gtk_builder_new ();
gtk_builder_add_objects_from_resource (builder, "/ui/appmenu.ui", ids, NULL);
appmenu = (GMenuModel *)gtk_builder_get_object (builder, "appmenu");
gtk_application_set_app_menu (GTK_APPLICATION (app), appmenu);
g_object_unref (builder);
}
static void
row_activated_cb (GtkWidget *tree_view,
GtkTreePath *path,
......@@ -1219,7 +1202,6 @@ main (int argc, char **argv)
g_application_add_main_option (G_APPLICATION (app), "list", 0, 0, G_OPTION_ARG_NONE, "List examples", NULL);
g_application_add_main_option (G_APPLICATION (app), "autoquit", 0, 0, G_OPTION_ARG_NONE, "Quit after a delay", NULL);
g_signal_connect (app, "startup", G_CALLBACK (startup), NULL);
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
g_signal_connect (app, "command-line", G_CALLBACK (command_line), NULL);
g_signal_connect (app, "handle-local-options", G_CALLBACK (local_options), NULL);
......
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<menu id="appmenu">
<section>
<item>
<attribute name="label" translatable="yes">_New</attribute>
<attribute name="action">app.new</attribute>
<attribute name="accel">&lt;Control&gt;n</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Open</attribute>
<attribute name="action">app.open</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Save</attribute>
<attribute name="action">app.save</attribute>
<attribute name="accel">&lt;Control&gt;s</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Save _As...</attribute>
<attribute name="action">app.save-as</attribute>
<attribute name="accel">&lt;Control&gt;s</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Quit</attribute>
<attribute name="action">app.quit</attribute>
<attribute name="accel">&lt;Control&gt;q</attribute>
</item>
</section>
</menu>
<menu id="menubar">
<submenu>
<attribute name="label" translatable="yes">_Preferences</attribute>
<attribute name="label" translatable="yes">_Application</attribute>
<section>
<item>
<attribute name="label" translatable="yes">_New</attribute>
<attribute name="action">app.new</attribute>
<attribute name="accel">&lt;Control&gt;n</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Open</attribute>
<attribute name="action">app.open</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Save</attribute>
<attribute name="action">app.save</attribute>
<attribute name="accel">&lt;Control&gt;s</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Save _As...</attribute>
<attribute name="action">app.save-as</attribute>
<attribute name="accel">&lt;Control&gt;s</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Quit</attribute>
<attribute name="action">app.quit</attribute>
<attribute name="accel">&lt;Control&gt;q</attribute>
</item>
</section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_File</attribute>
<section>
<item>
<attribute name="label" translatable="yes">_Prefer Dark Theme</attribute>
......
......@@ -641,24 +641,25 @@ static GActionEntry app_entries[] = {
static const gchar ui_info[] =
"<interface>"
" <menu id='appmenu'>"
" <section>"
" <item>"
" <attribute name='label'>_About</attribute>"
" <attribute name='action'>app.about</attribute>"
" <attribute name='accel'>&lt;Primary&gt;a</attribute>"
" </item>"
" </section>"
" <section>"
" <item>"
" <attribute name='label'>_Quit</attribute>"
" <attribute name='action'>app.quit</attribute>"
" <attribute name='accel'>&lt;Primary&gt;q</attribute>"
" </item>"
" </section>"
" </menu>"
" <menu id='menubar'>"
" <submenu>"
" <attribute name='label'>_Application</attribute>"
" <section>"
" <item>"
" <attribute name='label'>_About</attribute>"
" <attribute name='action'>app.about</attribute>"
" <attribute name='accel'>&lt;Primary&gt;a</attribute>"
" </item>"
" </section>"
" <section>"
" <item>"
" <attribute name='label'>_Quit</attribute>"
" <attribute name='action'>app.quit</attribute>"
" <attribute name='accel'>&lt;Primary&gt;q</attribute>"
" </item>"
" </section>"
" </submenu>"
" <submenu>"
" <attribute name='label'>_File</attribute>"
" <section>"
" <item>"
......@@ -738,16 +739,13 @@ static void
startup (GApplication *app)
{
GtkBuilder *builder;
GMenuModel *appmenu;
GMenuModel *menubar;
builder = gtk_builder_new ();
gtk_builder_add_from_string (builder, ui_info, -1, NULL);
appmenu = (GMenuModel *)gtk_builder_get_object (builder, "appmenu");
menubar = (GMenuModel *)gtk_builder_get_object (builder, "menubar");
gtk_application_set_app_menu (GTK_APPLICATION (app), appmenu);
gtk_application_set_menubar (GTK_APPLICATION (app), menubar);
g_object_unref (builder);
......
......@@ -5180,9 +5180,6 @@ gtk_application_inhibit
gtk_application_uninhibit
<SUBSECTION>
gtk_application_prefers_app_menu
gtk_application_get_app_menu
gtk_application_set_app_menu
gtk_application_get_menubar
gtk_application_set_menubar
gtk_application_get_menu_by_id
......
......@@ -245,6 +245,17 @@
the amount of work you have to do at the time of the switch.
</para>
</section>
<section>
<title>Stop using app menus</title>
<para>
GNOME has stopped using exported app menus some time ago, and GTK 4 is
dropping the GtkApplication APIs that are related to app menus. If you
want to transparently support menubars on OS X, you can integrate the
items from your app menu into your menubar, and keep using
gtk_application_set_menubar().
</para>
</section>
</section>
<section>
......
......@@ -4,12 +4,12 @@
static const char *red_css =
"textview>text {"
"textview {"
" color: red;"
"}";
static const char *black_css =
"textview>text {"
"textview {"
" color: black;"
"}";
......@@ -81,6 +81,7 @@ new_window (GApplication *app,
gtk_window_set_default_size ((GtkWindow*)window, 640, 480);
g_action_map_add_action_entries (G_ACTION_MAP (window), win_entries, G_N_ELEMENTS (win_entries), window);
gtk_window_set_title (GTK_WINDOW (window), "Plugman");
gtk_application_window_set_show_menubar (GTK_APPLICATION_WINDOW (window), TRUE);
grid = gtk_grid_new ();
gtk_window_set_child (GTK_WINDOW (window), grid);
......@@ -334,9 +335,10 @@ configure_plugins (GSimpleAction *action,
"<interface>"
" <object class='GtkDialog' id='plugin-dialog'>"
" <property name='title'>Plugins</property>"
" <child internal-child='vbox'>"
" <child internal-child='content_area'>"
" <object class='GtkBox' id='content-area'>"
" <property name='visible'>True</property>"
" <property name='orientation'>vertical</property>"
" <child>"
" <object class='GtkCheckButton' id='red-plugin'>"
" <property name='label' translatable='yes'>Red Plugin - turn your text red</property>"
......@@ -352,7 +354,7 @@ configure_plugins (GSimpleAction *action,
" </object>"
" </child>"
" <child internal-child='action_area'>"
" <object class='GtkButtonBox' id='action-area'>"
" <object class='GtkBox' id='action-area'>"
" <property name='visible'>True</property>"
" <child>"
" <object class='GtkButton' id='close-button'>"
......@@ -409,23 +411,24 @@ plug_man_startup (GApplication *application)
builder = gtk_builder_new ();
gtk_builder_add_from_string (builder,
"<interface>"
" <menu id='app-menu'>"
" <section>"
" <item>"
" <attribute name='label' translatable='yes'>_About Plugman</attribute>"
" <attribute name='action'>app.about</attribute>"
" </item>"
" </section>"
" <section>"
" <item>"
" <attribute name='label' translatable='yes'>_Quit</attribute>"
" <attribute name='action'>app.quit</attribute>"
" <attribute name='accel'>&lt;Primary&gt;q</attribute>"
" </item>"
" </section>"
" </menu>"
" <menu id='menubar'>"
" <submenu>"
" <attribute name='label' translatable='yes'>_Plugman</attribute>"
" <section>"
" <item>"
" <attribute name='label' translatable='yes'>_About Plugman</attribute>"
" <attribute name='action'>app.about</attribute>"
" </item>"
" </section>"
" <section>"
" <item>"
" <attribute name='label' translatable='yes'>_Quit</attribute>"
" <attribute name='action'>app.quit</attribute>"
" <attribute name='accel'>&lt;Primary&gt;q</attribute>"
" </item>"
" </section>"
" </submenu>"
" <submenu>"
" <attribute name='label' translatable='yes'>_Edit</attribute>"
" <section>"
" <item>"
......@@ -457,7 +460,6 @@ plug_man_startup (GApplication *application)
" </submenu>"
" </menu>"
"</interface>", -1, NULL);
gtk_application_set_app_menu (GTK_APPLICATION (application), G_MENU_MODEL (gtk_builder_get_object (builder, "app-menu")));
gtk_application_set_menubar (GTK_APPLICATION (application), G_MENU_MODEL (gtk_builder_get_object (builder, "menubar")));
g_object_set_data_full (G_OBJECT (application), "plugin-menu", gtk_builder_get_object (builder, "plugins"), g_object_unref);
g_object_unref (builder);
......
......@@ -9,7 +9,7 @@ new_window (GApplication *app,
GtkWidget *header;
window = gtk_application_window_new (GTK_APPLICATION (app));
gtk_application_window_set_show_menubar (GTK_APPLICATION_WINDOW (window), FALSE);
gtk_application_window_set_show_menubar (GTK_APPLICATION_WINDOW (window), TRUE);
gtk_window_set_default_size ((GtkWindow*)window, 640, 480);
gtk_window_set_title (GTK_WINDOW (window), "Sunny");
gtk_window_set_icon_name (GTK_WINDOW (window), "sunny");
......@@ -138,25 +138,28 @@ startup (GApplication *application)
builder = gtk_builder_new ();
gtk_builder_add_from_string (builder,
"<interface>"
" <menu id='app-menu'>"
" <section>"
" <item>"
" <attribute name='label' translatable='yes'>_New Window</attribute>"
" <attribute name='action'>app.new</attribute>"
" </item>"
" <item>"
" <attribute name='label' translatable='yes'>_About Sunny</attribute>"
" <attribute name='action'>app.about</attribute>"
" </item>"
" <item>"
" <attribute name='label' translatable='yes'>_Quit</attribute>"
" <attribute name='action'>app.quit</attribute>"
" <attribute name='accel'>&lt;Primary&gt;q</attribute>"
" </item>"
" </section>"
" <menu id='menubar'>"
" <submenu>"
" <attribute name='label' translatable='yes'>Sunny</attribute>"
" <section>"
" <item>"
" <attribute name='label' translatable='yes'>_New Window</attribute>"
" <attribute name='action'>app.new</attribute>"
" </item>"
" <item>"
" <attribute name='label' translatable='yes'>_About Sunny</attribute>"
" <attribute name='action'>app.about</attribute>"
" </item>"
" <item>"
" <attribute name='label' translatable='yes'>_Quit</attribute>"
" <attribute name='action'>app.quit</attribute>"
" <attribute name='accel'>&lt;Primary&gt;q</attribute>"
" </item>"
" </section>"
" </submenu>"
" </menu>"
"</interface>", -1, NULL);
gtk_application_set_app_menu (GTK_APPLICATION (application), G_MENU_MODEL (gtk_builder_get_object (builder, "app-menu")));
gtk_application_set_menubar (GTK_APPLICATION (application), G_MENU_MODEL (gtk_builder_get_object (builder, "menubar")));
g_object_unref (builder);
}
......
......@@ -78,22 +78,14 @@
*
* #GtkApplication will automatically load menus from the #GtkBuilder
* resource located at "gtk/menus.ui", relative to the application's
* resource base path (see g_application_set_resource_base_path()). The
* menu with the ID "app-menu" is taken as the application's app menu
* and the menu with the ID "menubar" is taken as the application's
* resource base path (see g_application_set_resource_base_path()).
* The menu with the ID "menubar" is taken as the application's
* menubar. Additional menus (most interesting submenus) can be named
* and accessed via gtk_application_get_menu_by_id() which allows for
* dynamic population of a part of the menu structure.
*
* If the resources "gtk/menus-appmenu.ui" or "gtk/menus-traditional.ui" are
* present then these files will be used in preference, depending on the value
* of gtk_application_prefers_app_menu(). If the resource "gtk/menus-common.ui"
* is present it will be loaded as well. This is useful for storing items that
* are referenced from both "gtk/menus-appmenu.ui" and
* "gtk/menus-traditional.ui".
*
* It is also possible to provide the menus manually using
* gtk_application_set_app_menu() and gtk_application_set_menubar().
* It is also possible to provide the menubar manually using
* gtk_application_set_menubar().
*
* #GtkApplication will also automatically setup an icon search path for
* the default icon theme by appending "icons" to the resource base
......@@ -143,7 +135,6 @@ enum {
PROP_ZERO,
PROP_REGISTER_SESSION,
PROP_SCREENSAVER_ACTIVE,
PROP_APP_MENU,
PROP_MENUBAR,
PROP_ACTIVE_WINDOW,
NUM_PROPERTIES
......@@ -158,7 +149,6 @@ typedef struct
GList *windows;
GMenuModel *app_menu;
GMenuModel *menubar;
guint last_window_id;
......@@ -223,48 +213,15 @@ gtk_application_load_resources (GtkApplication *application)
{
gchar *menuspath;
/* If the user has given a specific file for the variant of menu
* that we are looking for, use it with preference.
*/
if (gtk_application_prefers_app_menu (application))
menuspath = g_strconcat (base_path, "/gtk/menus-appmenu.ui", NULL);
else
menuspath = g_strconcat (base_path, "/gtk/menus-traditional.ui", NULL);
menuspath = g_strconcat (base_path, "/gtk/menus.ui", NULL);
if (g_resources_get_info (menuspath, G_RESOURCE_LOOKUP_FLAGS_NONE, NULL, NULL, NULL))
priv->menus_builder = gtk_builder_new_from_resource (menuspath);
g_free (menuspath);
/* If we didn't get the specific file, fall back. */
if (priv->menus_builder == NULL)
{
menuspath = g_strconcat (base_path, "/gtk/menus.ui", NULL);
if (g_resources_get_info (menuspath, G_RESOURCE_LOOKUP_FLAGS_NONE, NULL, NULL, NULL))
priv->menus_builder = gtk_builder_new_from_resource (menuspath);
g_free (menuspath);
}
/* Always load from -common as well, if we have it */
menuspath = g_strconcat (base_path, "/gtk/menus-common.ui", NULL);
if (g_resources_get_info (menuspath, G_RESOURCE_LOOKUP_FLAGS_NONE, NULL, NULL, NULL))
{
GError *error = NULL;
if (priv->menus_builder == NULL)
priv->menus_builder = gtk_builder_new ();
if (!gtk_builder_add_from_resource (priv->menus_builder, menuspath, &error))
g_error ("failed to load menus-common.ui: %s", error->message);
}
g_free (menuspath);
if (priv->menus_builder)
{
GObject *menu;
menu = gtk_builder_get_object (priv->menus_builder, "app-menu");
if (menu != NULL && G_IS_MENU_MODEL (menu))
gtk_application_set_app_menu (application, G_MENU_MODEL (menu));
menu = gtk_builder_get_object (priv->menus_builder, "menubar");
if (menu != NULL && G_IS_MENU_MODEL (menu))
gtk_application_set_menubar (application, G_MENU_MODEL (menu));
......@@ -490,10 +447,6 @@ gtk_application_get_property (GObject *object,
g_value_set_boolean (value, priv->screensaver_active);
break;
case PROP_APP_MENU:
g_value_set_object (value, gtk_application_get_app_menu (application));
break;
case PROP_MENUBAR:
g_value_set_object (value, gtk_application_get_menubar (application));
break;
......@@ -523,10 +476,6 @@ gtk_application_set_property (GObject *object,
priv->register_session = g_value_get_boolean (value);
break;
case PROP_APP_MENU:
gtk_application_set_app_menu (application, g_value_get_object (value));
break;
case PROP_MENUBAR:
gtk_application_set_menubar (application, g_value_get_object (value));
break;
......@@ -544,7 +493,6 @@ gtk_application_finalize (GObject *object)
GtkApplicationPrivate *priv = gtk_application_get_instance_private (application);
g_clear_object (&priv->menus_builder);
g_clear_object (&priv->app_menu);
g_clear_object (&priv->menubar);
g_clear_object (&priv->muxer);
g_clear_object (&priv->accels);
......@@ -800,13 +748,6 @@ gtk_application_class_init (GtkApplicationClass *class)
FALSE,
G_PARAM_READABLE|G_PARAM_STATIC_STRINGS);
gtk_application_props[PROP_APP_MENU] =
g_param_spec_object ("app-menu",
P_("Application menu"),
P_("The GMenuModel for the application menu"),
G_TYPE_MENU_MODEL,
G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS);
gtk_application_props[PROP_MENUBAR] =
g_param_spec_object ("menubar",
P_("Menubar"),
......@@ -1029,120 +970,6 @@ gtk_application_update_accels (GtkApplication *application)
_gtk_window_notify_keys_changed (l->data);
}
/**
* gtk_application_prefers_app_menu:
* @application: a #GtkApplication
*
* Determines if the desktop environment in which the application is
* running would prefer an application menu be shown.
*
* If this function returns %TRUE then the application should call
* gtk_application_set_app_menu() with the contents of an application
* menu, which will be shown by the desktop environment. If it returns
* %FALSE then you should consider using an alternate approach, such as
* a menubar.
*
* The value returned by this function is purely advisory and you are
* free to ignore it. If you call gtk_application_set_app_menu() even
* if the desktop environment doesn't support app menus, then a fallback
* will be provided.
*
* Applications are similarly free not to set an app menu even if the
* desktop environment wants to show one. In that case, a fallback will
* also be created by the desktop environment (GNOME, for example, uses
* a menu with only a "Quit" item in it).
*
* The value returned by this function never changes. Once it returns a
* particular value, it is guaranteed to always return the same value.
*
* You may only call this function after the application has been
* registered and after the base startup handler has run. You're most
* likely to want to use this from your own startup handler. It may
* also make sense to consult this function while constructing UI (in
* activate, open or an action activation handler) in order to determine
* if you should show a gear menu or not.
*
* This function will return %FALSE on Mac OS and a default app menu
* will be created automatically with the "usual" contents of that menu
* typical to most Mac OS applications. If you call
* gtk_application_set_app_menu() anyway, then this menu will be
* replaced with your own.
*
* Returns: %TRUE if you should set an app menu
**/
gboolean
gtk_application_prefers_app_menu (GtkApplication *application)
{
GtkApplicationPrivate *priv = gtk_application_get_instance_private (application);
g_return_val_if_fail (GTK_IS_APPLICATION (application), FALSE);
g_return_val_if_fail (priv->impl != NULL, FALSE);
return gtk_application_impl_prefers_app_menu (priv->impl);
}
/**
* gtk_application_set_app_menu:
* @application: a #GtkApplication
* @app_menu: (allow-none): a #GMenuModel, or %NULL
*
* Sets or unsets the application menu for @application.
*
* This can only be done in the primary instance of the application,
* after it has been registered. #GApplication::startup is a good place
* to call this.
*
* The application menu is a single menu containing items that typically
* impact the application as a whole, rather than acting on a specific
* window or document. For example, you would expect to see
* “Preferences” or “Quit” in an application menu, but not “Save” or
* “Print”.
*
* If supported, the application menu will be rendered by the desktop
* environment.
*
* Use the base #GActionMap interface to add actions, to respond to the user
* selecting these menu items.
*/
void
gtk_application_set_app_menu (GtkApplication *application,
GMenuModel *app_menu)
{
GtkApplicationPrivate *priv = gtk_application_get_instance_private (application);
g_return_if_fail (GTK_IS_APPLICATION (application));
g_return_if_fail (g_application_get_is_registered (G_APPLICATION (application)));
g_return_if_fail (!g_application_get_is_remote (G_APPLICATION (application)));
g_return_if_fail (app_menu == NULL || G_IS_MENU_MODEL (app_menu));
if (g_set_object (&priv->app_menu, app_menu))
{
gtk_application_impl_set_app_menu (priv->impl, app_menu);
g_object_notify_by_pspec (G_OBJECT (application), gtk_application_props[PROP_APP_MENU]);
}
}
/**
* gtk_application_get_app_menu:
* @application: a #GtkApplication
*
* Returns the menu model that has been set with
* gtk_application_set_app_menu().
*
* Returns: (transfer none) (nullable): the application menu of @application
* or %NULL if no application menu has been set.
*/
GMenuModel *
gtk_application_get_app_menu (GtkApplication *application)
{
GtkApplicationPrivate *priv = gtk_application_get_instance_private (application);
g_return_val_if_fail (GTK_IS_APPLICATION (application), NULL);
return priv->app_menu;
}
/**
* gtk_application_set_menubar:
* @application: a #GtkApplication
......
......@@ -85,12 +85,6 @@ void gtk_application_remove_window (GtkApplication *application,
GDK_AVAILABLE_IN_ALL
GList * gtk_application_get_windows (GtkApplication *application);
GDK_AVAILABLE_IN_ALL
GMenuModel * gtk_application_get_app_menu (GtkApplication *application);
GDK_AVAILABLE_IN_ALL
void gtk_application_set_app_menu (GtkApplication *application,
GMenuModel *app_menu);
GDK_AVAILABLE_IN_ALL
GMenuModel * gtk_application_get_menubar (GtkApplication *application);
GDK_AVAILABLE_IN_ALL
......@@ -137,9 +131,6 @@ void gtk_application_set_accels_for_action (GtkApplication
const gchar *detailed_action_name,
const gchar * const *accels);
GDK_AVAILABLE_IN_ALL
gboolean gtk_application_prefers_app_menu (GtkApplication *application);
GDK_AVAILABLE_IN_ALL
GMenu * gtk_application_get_menu_by_id (GtkApplication *application,
const gchar *id);
......
......@@ -41,9 +41,8 @@
*
* #GtkApplicationWindow is a #GtkWindow subclass that offers some
* extra functionality for better integration with #GtkApplication
* features. Notably, it can handle both the application menu as well
* as the menubar. See gtk_application_set_app_menu() and
* gtk_application_set_menubar().
* features. Notably, it can handle an application menubar.
* See gtk_application_set_menubar().
*
* This class implements the #GActionGroup and #GActionMap interfaces,
* to let you add window-specific actions that will be exported by the
......@@ -191,7 +190,6 @@ struct _GtkApplicationWindowPrivate
GtkWidget *menubar;
gboolean show_menubar;
GMenu *app_menu_section;
GMenu *menubar_section;
guint id;
......@@ -217,8 +215,7 @@ gtk_application_window_update_menubar (GtkApplicationWindow *window)
have_menubar = priv->menubar != NULL;