Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(622)

Unified Diff: ui/views/controls/menu/menu_runner.cc

Issue 12529012: Context menu on views must show on mouse down for non-WIN. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Context menu on views must show on mouse down for non-WIN. Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/views/view.cc » ('j') | ui/views/view.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 694503cc3fc3cd3b54ccb05eceef551ca88e76d5..c7ed7a3b8032cf19a731a1440f8257bfe312d928 100644
--- a/ui/views/controls/menu/menu_runner.cc
+++ b/ui/views/controls/menu/menu_runner.cc
@@ -341,6 +341,12 @@ MenuRunner::RunResult MenuRunner::RunMenuAt(Widget* parent,
anchor = parent->GetCurrentEvent()->IsGestureEvent() ?
MenuItemView::BOTTOMCENTER : MenuItemView::TOPLEFT;
+ // 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())
+ parent->GetRootView()->SetMouseHandler(NULL);
sky 2013/03/20 21:35:53 This means a view isn't going to get a mouse exite
varunjain 2013/03/20 22:05:52 SetMouseHandler(NULL) does not reset the mouse_mov
+
return holder_->RunMenuAt(parent, button, bounds, anchor, types);
}
« no previous file with comments | « no previous file | ui/views/view.cc » ('j') | ui/views/view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698