fix: crash when alt key pressed with falsy menu bar visiblity (#17766)

This commit is contained in:
Vlad Hashimoto 2019-04-15 20:54:27 +03:00 committed by Samuel Attard
parent 748632d655
commit 258d337cf8

View file

@ -145,9 +145,11 @@ void RootView::HandleKeyEvent(const content::NativeWebKeyboardEvent& event) {
View* focused_view = GetFocusManager()->GetFocusedView();
last_focused_view_tracker_->SetView(focused_view);
if (menu_bar_visible_) {
menu_bar_->RequestFocus();
// Show accelerators when menu bar is focused
menu_bar_->SetAcceleratorVisibility(true);
}
} else {
// When any other keys except single Alt have been pressed/released:
menu_bar_alt_pressed_ = false;