From 3260b8f14253bf4e46fb2e0a7a203bdfe214e682 Mon Sep 17 00:00:00 2001 From: "g.willems" Date: Thu, 22 Aug 2024 20:39:59 +0200 Subject: [PATCH] applicationwindow: set menubar a11y label This fixes a warning from the inspector's accessibility checker. Users only control the menu model, not the menubar widget, so this can only be done in gtk. --- gtk/gtkapplicationwindow.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gtk/gtkapplicationwindow.c b/gtk/gtkapplicationwindow.c index 9ac02dee2e..5a34c27dee 100644 --- a/gtk/gtkapplicationwindow.c +++ b/gtk/gtkapplicationwindow.c @@ -29,6 +29,8 @@ #include "gtkshortcutswindowprivate.h" #include "gtktooltipprivate.h" +#include + /** * GtkApplicationWindow: * @@ -230,6 +232,9 @@ gtk_application_window_update_menubar (GtkApplicationWindow *window) g_menu_append_section (combined, NULL, G_MENU_MODEL (priv->menubar_section)); priv->menubar = gtk_popover_menu_bar_new_from_model (G_MENU_MODEL (combined)); + gtk_accessible_update_property (GTK_ACCESSIBLE (priv->menubar), + GTK_ACCESSIBLE_PROPERTY_LABEL, _("Menu bar"), + -1); gtk_widget_set_parent (priv->menubar, GTK_WIDGET (window)); g_object_unref (combined); }