diff options
author | William Jon McCann <william.jon.mccann@gmail.com> | 2013-06-26 14:21:44 -0400 |
---|---|---|
committer | William Jon McCann <william.jon.mccann@gmail.com> | 2013-06-26 14:21:44 -0400 |
commit | b26c74e5dac0b5fd869d2c8cc7a0edb6b01aeebd (patch) | |
tree | 55a16d32528e7a17d65e3b408d981132dabb4dfc /gtk/gtkmenubar.c | |
parent | 76936193d59baf3b744061ef5219c7500e44abaf (diff) | |
download | gtk+-b26c74e5dac0b5fd869d2c8cc7a0edb6b01aeebd.tar.gz |
Deprecate and ignore gtk-menu-bar-accel setting
Use 'F10' by default.
Diffstat (limited to 'gtk/gtkmenubar.c')
-rw-r--r-- | gtk/gtkmenubar.c | 57 |
1 files changed, 19 insertions, 38 deletions
diff --git a/gtk/gtkmenubar.c b/gtk/gtkmenubar.c index 0a49fed87d..f93afa497f 100644 --- a/gtk/gtkmenubar.c +++ b/gtk/gtkmenubar.c @@ -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; - - gtk_accelerator_parse (accel, &keyval, &mods); + GList *tmp_menubars = get_viewable_menu_bars (GTK_WINDOW (widget)); + GList *menubars; - if (keyval == 0) - g_warning ("Failed to parse menu bar accelerator '%s'\n", accel); + menubars = _gtk_container_focus_sort (GTK_CONTAINER (widget), tmp_menubars, + GTK_DIR_TAB_FORWARD, NULL); + g_list_free (tmp_menubars); - /* 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); - - g_list_free (menubars); - - retval = TRUE; - } + _gtk_menu_shell_set_keyboard_mode (menu_shell, TRUE); + gtk_menu_shell_select_first (menu_shell, FALSE); + + g_list_free (menubars); + + retval = TRUE; } } - g_free (accel); - return retval; } |