diff options
Diffstat (limited to 'ui/views/controls/menu/menu_host.cc')
-rw-r--r-- | ui/views/controls/menu/menu_host.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ui/views/controls/menu/menu_host.cc b/ui/views/controls/menu/menu_host.cc index a9f2f7f..4a887e5 100644 --- a/ui/views/controls/menu/menu_host.cc +++ b/ui/views/controls/menu/menu_host.cc @@ -49,7 +49,7 @@ void MenuHost::ShowMenuHost(bool do_capture) { ignore_capture_lost_ = true; Show(); if (do_capture) - native_widget_private()->SetCapture(); + native_widget_private()->SetCapture(ui::CW_LOCK_MOUSE | ui::CW_LOCK_TOUCH); ignore_capture_lost_ = false; } @@ -72,7 +72,8 @@ void MenuHost::SetMenuHostBounds(const gfx::Rect& bounds) { } void MenuHost::ReleaseMenuHostCapture() { - if (native_widget_private()->HasCapture()) + if (native_widget_private()->HasCapture(ui::CW_LOCK_MOUSE) || + native_widget_private()->HasCapture(ui::CW_LOCK_TOUCH)) native_widget_private()->ReleaseCapture(); } |