diff options
author | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-16 03:28:02 +0000 |
---|---|---|
committer | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-16 03:28:02 +0000 |
commit | 8a680795288acc86ca0e5ab95d694d59e48fd791 (patch) | |
tree | 6b462739730f1ecd2ddfb1e0caec8351561d6dcf /chrome/browser/gtk/menu_gtk.cc | |
parent | 1f31bb798cc0c1b1f4a848bbea961ae977510307 (diff) | |
download | chromium_src-8a680795288acc86ca0e5ab95d694d59e48fd791.zip chromium_src-8a680795288acc86ca0e5ab95d694d59e48fd791.tar.gz chromium_src-8a680795288acc86ca0e5ab95d694d59e48fd791.tar.bz2 |
Fix radio items in MenuGtk.
Suppose there are three radio items A, B, C, and A is now being
checked. If you click C, commands associated with A and C are both
executed. This is because A also receives the "activate" signal,
before C receives it.
BUG=30450
TEST=try; manually with gdb with the steps described in crbug.com/30450.
Review URL: http://codereview.chromium.org/506010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34647 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/menu_gtk.cc')
-rw-r--r-- | chrome/browser/gtk/menu_gtk.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/chrome/browser/gtk/menu_gtk.cc b/chrome/browser/gtk/menu_gtk.cc index 4db7082..2a9ab51 100644 --- a/chrome/browser/gtk/menu_gtk.cc +++ b/chrome/browser/gtk/menu_gtk.cc @@ -251,6 +251,13 @@ void MenuGtk::OnMenuItemActivated(GtkMenuItem* menuitem, MenuGtk* menu) { if (gtk_menu_item_get_submenu(menuitem)) return; + // The activate signal is sent to radio items as they get deselected; + // ignore it in this case. + if (GTK_IS_RADIO_MENU_ITEM(menuitem) && + !gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem))) { + return; + } + const MenuCreateMaterial* data = reinterpret_cast<const MenuCreateMaterial*>( g_object_get_data(G_OBJECT(menuitem), "menu-data")); |