Skip to content

Commit

Permalink
macviews: reset closure animation on ReallyAccept
Browse files Browse the repository at this point in the history
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 <sky@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551410}
  • Loading branch information
Elly Fong-Jones authored and Commit Bot committed Apr 17, 2018
1 parent 90da872 commit 37ab908
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ui/views/controls/menu/menu_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 37ab908

Please sign in to comment.