Chromium Code Reviews| Index: ui/views/controls/menu/menu_runner.cc |
| diff --git a/ui/views/controls/menu/menu_runner.cc b/ui/views/controls/menu/menu_runner.cc |
| index bd07a839aefec3cd9f3e1492de5ff5ff2ebb904d..e3fe6d1b54dda839794e2e55e9f093855457c511 100644 |
| --- a/ui/views/controls/menu/menu_runner.cc |
| +++ b/ui/views/controls/menu/menu_runner.cc |
| @@ -8,6 +8,7 @@ |
| #include "ui/views/controls/menu/menu_runner_handler.h" |
| #include "ui/views/controls/menu/menu_runner_impl.h" |
| +#include "ui/views/widget/widget.h" |
| namespace views { |
| @@ -56,6 +57,12 @@ MenuRunner::RunResult MenuRunner::RunMenuAt(Widget* parent, |
| } |
| } |
| + // If we are shown on mouse press, we will eat the subsequent mouse down and |
| + // the parent widget will not be able to reset its state (it might have mouse |
| + // capture from the mouse down). So we clear its state here. |
| + if (parent && parent->GetRootView()) |
|
sky
2016/10/26 17:46:11
Can you clarify why you need need to move this her
themblsha
2016/10/27 15:05:28
As tapted suggested in his first comment, this see
|
| + parent->GetRootView()->SetMouseHandler(nullptr); |
| + |
| return impl_->RunMenuAt(parent, button, bounds, anchor, run_types_); |
| } |