From 37ab908e08c8a87602ec455705bad9aedde7a66e Mon Sep 17 00:00:00 2001 From: Elly Fong-Jones Date: Tue, 17 Apr 2018 18:54:30 +0000 Subject: [PATCH] macviews: reset closure animation on ReallyAccept Accept() can be called more than once on the same MenuController, via context menus; in this situation, it's important to clear the animation so that input events get handled after the animation completes. Bug: 833048 Change-Id: Id3ac92ce91e78b57f2120d4527e35e597ea03067 Reviewed-on: https://chromium-review.googlesource.com/1012876 Reviewed-by: Scott Violet Commit-Queue: Elly Fong-Jones Cr-Commit-Position: refs/heads/master@{#551410} --- ui/views/controls/menu/menu_controller.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc index 1e6f6cc17281c..46713d7170a66 100644 --- a/ui/views/controls/menu/menu_controller.cc +++ b/ui/views/controls/menu/menu_controller.cc @@ -1493,6 +1493,11 @@ void MenuController::Accept(MenuItemView* item, int event_flags) { void MenuController::ReallyAccept(MenuItemView* item, int event_flags) { DCHECK(IsBlockingRun()); result_ = item; +#if defined(OS_MACOSX) + // Reset the closure animation since it's now finished - this also unblocks + // input events for the menu. + menu_closure_animation_.reset(); +#endif if (item && !menu_stack_.empty() && !item->GetDelegate()->ShouldCloseAllMenusOnExecute(item->GetCommand())) { SetExitType(EXIT_OUTERMOST);