Deprecate and ignore gtk-menu-bar-accel setting

Use 'F10' by default.
This commit is contained in:
William Jon McCann 2013-06-26 14:21:44 -04:00
parent 76936193d5
commit b26c74e5da
4 changed files with 25 additions and 39 deletions

View File

@ -315,7 +315,6 @@ _gdk_win32_window_delete_property (GdkWindow *window,
"Gtk/IMStatusStyle\0" "gtk-im-status-style\0"
"Gtk/Modules\0" "gtk-modules\0"
"Gtk/FileChooserBackend\0" "gtk-file-chooser-backend\0"
"Gtk/MenuBarAccel\0" "gtk-menu-bar-accel\0"
"Gtk/CursorThemeName\0" "gtk-cursor-theme-name\0"
"Gtk/CursorThemeSize\0" "gtk-cursor-theme-size\0"
"Gtk/TimeoutInitial\0" "gtk-timeout-initial\0"

View File

@ -40,7 +40,6 @@ static const struct {
{"Gtk/IMStatusStyle", "gtk-im-status-style"},
{"Gtk/Modules", "gtk-modules"},
{"Gtk/FileChooserBackend", "gtk-file-chooser-backend"},
{"Gtk/MenuBarAccel", "gtk-menu-bar-accel"},
{"Gtk/CursorThemeName", "gtk-cursor-theme-name"},
{"Gtk/CursorThemeSize", "gtk-cursor-theme-size"},
{"Gtk/TimeoutInitial", "gtk-timeout-initial"},

View File

@ -700,54 +700,35 @@ window_key_press_handler (GtkWidget *widget,
GdkEventKey *event,
gpointer data)
{
gchar *accel = NULL;
gboolean retval = FALSE;
g_object_get (gtk_widget_get_settings (widget),
"gtk-menu-bar-accel", &accel,
NULL);
guint keyval = GDK_KEY_F10;
if (accel && *accel)
/* FIXME this is wrong, needs to be in the global accel resolution
* thing, to properly consider i18n etc., but that probably requires
* AccelGroup changes etc.
*/
if (event->keyval == keyval && event->state == 0)
{
guint keyval = 0;
GdkModifierType mods = 0;
GList *tmp_menubars = get_viewable_menu_bars (GTK_WINDOW (widget));
GList *menubars;
gtk_accelerator_parse (accel, &keyval, &mods);
menubars = _gtk_container_focus_sort (GTK_CONTAINER (widget), tmp_menubars,
GTK_DIR_TAB_FORWARD, NULL);
g_list_free (tmp_menubars);
if (keyval == 0)
g_warning ("Failed to parse menu bar accelerator '%s'\n", accel);
/* FIXME this is wrong, needs to be in the global accel resolution
* thing, to properly consider i18n etc., but that probably requires
* AccelGroup changes etc.
*/
if (event->keyval == keyval &&
((event->state & gtk_accelerator_get_default_mod_mask ()) ==
(mods & gtk_accelerator_get_default_mod_mask ())))
if (menubars)
{
GList *tmp_menubars = get_viewable_menu_bars (GTK_WINDOW (widget));
GList *menubars;
GtkMenuShell *menu_shell = GTK_MENU_SHELL (menubars->data);
menubars = _gtk_container_focus_sort (GTK_CONTAINER (widget), tmp_menubars,
GTK_DIR_TAB_FORWARD, NULL);
g_list_free (tmp_menubars);
if (menubars)
{
GtkMenuShell *menu_shell = GTK_MENU_SHELL (menubars->data);
_gtk_menu_shell_set_keyboard_mode (menu_shell, TRUE);
gtk_menu_shell_select_first (menu_shell, FALSE);
_gtk_menu_shell_set_keyboard_mode (menu_shell, TRUE);
gtk_menu_shell_select_first (menu_shell, FALSE);
g_list_free (menubars);
retval = TRUE;
}
g_list_free (menubars);
retval = TRUE;
}
}
g_free (accel);
return retval;
}

View File

@ -473,6 +473,13 @@ gtk_settings_class_init (GtkSettingsClass *class)
NULL);
g_assert (result == PROP_KEY_THEME_NAME);
/**
* GtkSettings:gtk-menu-bar-accel:
*
* Keybinding to activate the menu bar.
*
* Deprecated: 3.10: This setting is ignored.
*/
result = settings_install_property_parser (class,
g_param_spec_string ("gtk-menu-bar-accel",
P_("Menu bar accelerator"),