diff options
author | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-16 03:08:37 +0000 |
---|---|---|
committer | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-16 03:08:37 +0000 |
commit | 0c458f04333a6512e5e6c36d91156814f6738795 (patch) | |
tree | 97b7e1958217854fa9e6f367a9c80de7b19687c8 /views | |
parent | d4b5711eeb1abed75382d9191f603850ac225f28 (diff) | |
download | chromium_src-0c458f04333a6512e5e6c36d91156814f6738795.zip chromium_src-0c458f04333a6512e5e6c36d91156814f6738795.tar.gz chromium_src-0c458f04333a6512e5e6c36d91156814f6738795.tar.bz2 |
Fix radio items in views::Menu2 for Linux.
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. We want only the command associated with A
to get executed.
BUG=30310
TEST=try; manually with view_examples
Review URL: http://codereview.chromium.org/491076
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34644 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/controls/menu/native_menu_gtk.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/views/controls/menu/native_menu_gtk.cc b/views/controls/menu/native_menu_gtk.cc index 9c5b39a..0bafffd 100644 --- a/views/controls/menu/native_menu_gtk.cc +++ b/views/controls/menu/native_menu_gtk.cc @@ -283,6 +283,16 @@ void NativeMenuGtk::OnActivate(GtkMenuItem* menu_item) { return; int position = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(menu_item), kPositionString)); + // Ignore the signal if it's sent to an inactive checked radio item. + // + // Suppose there are three radio items A, B, C, and A is now being + // checked. If you click C, "activate" signal will be sent to A and C. + // Here, we ignore the signal sent to A. + if (GTK_IS_RADIO_MENU_ITEM(menu_item) && + !gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menu_item))) { + return; + } + if (model_->IsEnabledAt(position) && MenuTypeCanExecute(model_->GetTypeAt(position))) { model_->ActivatedAt(position); |