Chromium Code Reviews| Index: ui/views/controls/menu/menu_runner_impl_cocoa.mm |
| diff --git a/ui/views/controls/menu/menu_runner_impl_cocoa.mm b/ui/views/controls/menu/menu_runner_impl_cocoa.mm |
| index f04c2eb2137fe934a57d7680a1c38a9fc721d607..7c79676262b974e09ab5dd378d5bca3173423c6c 100644 |
| --- a/ui/views/controls/menu/menu_runner_impl_cocoa.mm |
| +++ b/ui/views/controls/menu/menu_runner_impl_cocoa.mm |
| @@ -128,6 +128,12 @@ MenuRunner::RunResult MenuRunnerImplCocoa::RunMenuAt(Widget* parent, |
| closing_event_time_ = base::TimeTicks(); |
| running_ = true; |
| + // 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()) |
|
tapted
2016/10/26 02:15:31
above there's a DCHECK(parent), so there's no need
|
| + parent->GetRootView()->SetMouseHandler(nullptr); |
|
tapted
2016/10/26 02:15:31
This is just copied from menu_controller.cc - can
themblsha
2016/10/26 15:49:14
The fragment in browser.cc is from 2016, and it's
|
| + |
| if (run_types & MenuRunner::CONTEXT_MENU) { |
| [NSMenu popUpContextMenu:[menu_controller_ menu] |
| withEvent:[NSApp currentEvent] |