menubutton: Set accessible relations
authorMatthias Clasen <mclasen@redhat.com>
Sun, 11 Jun 2023 16:38:06 +0000 (12:38 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 12 Jun 2023 00:29:25 +0000 (20:29 -0400)
In the case where we create the popover, mark it
as labelled by the button.

gtk/gtkmenubutton.c

index eab3ad61ce08b97eff2d911c01eba22bf8f2a701..59fb9394e5d505b87d640b946816df94b10df288 100644 (file)
@@ -798,6 +798,11 @@ gtk_menu_button_set_menu_model (GtkMenuButton *menu_button,
       GtkWidget *popover;
 
       popover = gtk_popover_menu_new_from_model (menu_model);
+
+      gtk_accessible_update_relation (GTK_ACCESSIBLE (popover),
+                                      GTK_ACCESSIBLE_RELATION_LABELLED_BY, menu_button, NULL,
+                                      -1);
+
       gtk_menu_button_set_popover (menu_button, popover);
     }
   else