]> Pileus Git - ~andy/gtk/commitdiff
modelmenu: set the accel group on the GtkMenu
authorCosimo Cecchi <cosimoc@gnome.org>
Fri, 29 Jun 2012 22:29:42 +0000 (18:29 -0400)
committerCosimo Cecchi <cosimoc@gnome.org>
Thu, 5 Jul 2012 14:21:55 +0000 (10:21 -0400)
Or the accelerators added for actions in the menu won't be displayed in
the menu items.

https://bugzilla.gnome.org/show_bug.cgi?id=679166

gtk/gtkmodelmenu.c

index 1ac533dac9c3eb973a03cb32da5d14ae8fe26bdb..1f12595e52cdf1e6578699366b16140aea74a80e 100644 (file)
@@ -267,6 +267,7 @@ gtk_model_menu_create_menu (GMenuModel        *model,
   GtkWidget *menu;
 
   menu = gtk_menu_new ();
+  gtk_menu_set_accel_group (GTK_MENU (menu), accels);
 
   gtk_model_menu_bind (GTK_MENU_SHELL (menu), model, TRUE);
   gtk_model_menu_populate (GTK_MENU_SHELL (menu), actions, accels);
@@ -291,6 +292,7 @@ notify_attach (GtkMenu    *menu,
       actions = gtk_application_window_get_observable (GTK_APPLICATION_WINDOW (toplevel));
       accels = gtk_application_window_get_accel_group (GTK_APPLICATION_WINDOW (toplevel));
 
+      gtk_menu_set_accel_group (menu, accels);
       gtk_model_menu_populate (GTK_MENU_SHELL (menu), actions, accels);
     }
 }