diff options
author | Matthias Clasen <mclasen@redhat.com> | 2007-07-24 04:56:47 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2007-07-24 04:56:47 +0000 |
commit | 55c23d2b22096ae062af82383f21922ad8649d41 (patch) | |
tree | c9ed26fc9a45b80ab078235757d81b7c11e4ba83 /gtk/gtkmenu.c | |
parent | 17aacf414dd585f4bd64515eb4fa4e249025c97d (diff) | |
download | gtk+-55c23d2b22096ae062af82383f21922ad8649d41.tar.gz |
Restructure the code to make sense, and don't leak an empty accel.
2007-07-24 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkmenubar.c (window_key_press_handler):
* gtk/gtkmenu.c (gtk_menu_key_press): Restructure the code
to make sense, and don't leak an empty accel. (#459515, Owen Taylor)
svn path=/trunk/; revision=18535
Diffstat (limited to 'gtk/gtkmenu.c')
-rw-r--r-- | gtk/gtkmenu.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c index 66fd3108df..6e99ce0bf1 100644 --- a/gtk/gtkmenu.c +++ b/gtk/gtkmenu.c @@ -2786,7 +2786,6 @@ gtk_menu_key_press (GtkWidget *widget, { guint keyval = 0; GdkModifierType mods = 0; - gboolean handled = FALSE; gtk_accelerator_parse (accel, &keyval, &mods); @@ -2797,15 +2796,15 @@ gtk_menu_key_press (GtkWidget *widget, * thing, to properly consider i18n etc., but that probably requires * AccelGroup changes etc. */ - if (event->keyval == keyval && - (mods & event->state) == mods) - gtk_menu_shell_cancel (menu_shell); - - g_free (accel); - - if (handled) - return TRUE; + if (event->keyval == keyval && (mods & event->state) == mods) + { + gtk_menu_shell_cancel (menu_shell); + g_free (accel); + return TRUE; + } } + + g_free (accel); switch (event->keyval) { |