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

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

Issue 2450903002: MacViews: Clear mouse handler when showing context menus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved fix to MenuRunner::RunMenuAt, remove redundant fixes. Created 4 years, 2 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 | « ui/views/controls/menu/menu_controller.cc ('k') | no next file » | no next file with comments »
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 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_);
}
« no previous file with comments | « ui/views/controls/menu/menu_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698