Index: ui/views/controls/button/menu_button.cc |
diff --git a/ui/views/controls/button/menu_button.cc b/ui/views/controls/button/menu_button.cc |
index 22a79ae12406380cd91ab0a68ea8d6184d0f64c0..46eaca426033c2d0cea3366749b3f2b8dd582d76 100644 |
--- a/ui/views/controls/button/menu_button.cc |
+++ b/ui/views/controls/button/menu_button.cc |
@@ -91,7 +91,6 @@ MenuButton::~MenuButton() { |
//////////////////////////////////////////////////////////////////////////////// |
bool MenuButton::Activate() { |
- PressedLock pressed_lock(this); |
if (listener_) { |
gfx::Rect lb = GetLocalBounds(); |
@@ -216,9 +215,12 @@ void MenuButton::OnMouseMoved(const ui::MouseEvent& event) { |
void MenuButton::OnGestureEvent(ui::GestureEvent* event) { |
if (state() != STATE_DISABLED) { |
if (ShouldEnterPushedState(*event) && !Activate()) { |
- // When |Activate()| returns |false|, it means that a menu is shown and |
- // has handled the gesture event. So, there is no need to further process |
- // the gesture event here. |
+ // When |Activate()| returns |false|, it means the click was handled by |
+ // a button listener and has handled the gesture event. So, there is no |
+ // need to further process the gesture event here. However, if the |
+ // listener didn't run menu code, we should make sure to reset our state. |
+ if (state() == Button::STATE_HOVERED) |
Devlin
2015/12/05 00:28:27
This is kind of awkward, but important since we en
|
+ SetState(Button::STATE_NORMAL); |
return; |
} |
if (switches::IsTouchFeedbackEnabled()) { |