summaryrefslogtreecommitdiffstats
path: root/views/controls/button/menu_button.cc
diff options
context:
space:
mode:
Diffstat (limited to 'views/controls/button/menu_button.cc')
-rw-r--r--views/controls/button/menu_button.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/views/controls/button/menu_button.cc b/views/controls/button/menu_button.cc
index ced0942..7fb81cb 100644
--- a/views/controls/button/menu_button.cc
+++ b/views/controls/button/menu_button.cc
@@ -188,9 +188,13 @@ bool MenuButton::OnMousePressed(const MouseEvent& e) {
void MenuButton::OnMouseReleased(const MouseEvent& e,
bool canceled) {
+ // Explicitly test for left mouse button to show the menu. If we tested for
+ // !IsTriggerableEvent it could lead to a situation where we end up showing
+ // the menu and context menu (this would happen if the right button is not
+ // triggerable and there's a context menu).
if (GetDragOperations(e.x(), e.y()) != DragDropTypes::DRAG_NONE &&
- state() != BS_DISABLED && !canceled && !InDrag() && !IsTriggerableEvent(e)
- && HitTest(e.location())) {
+ state() != BS_DISABLED && !canceled && !InDrag() &&
+ e.IsOnlyLeftMouseButton() && HitTest(e.location())) {
Activate();
} else {
TextButton::OnMouseReleased(e, canceled);