fix: crash when alt key pressed with falsy menu bar visiblity (#17766)
This commit is contained in:
parent
748632d655
commit
258d337cf8
1 changed files with 5 additions and 3 deletions
|
@ -145,9 +145,11 @@ void RootView::HandleKeyEvent(const content::NativeWebKeyboardEvent& event) {
|
||||||
|
|
||||||
View* focused_view = GetFocusManager()->GetFocusedView();
|
View* focused_view = GetFocusManager()->GetFocusedView();
|
||||||
last_focused_view_tracker_->SetView(focused_view);
|
last_focused_view_tracker_->SetView(focused_view);
|
||||||
menu_bar_->RequestFocus();
|
if (menu_bar_visible_) {
|
||||||
// Show accelerators when menu bar is focused
|
menu_bar_->RequestFocus();
|
||||||
menu_bar_->SetAcceleratorVisibility(true);
|
// Show accelerators when menu bar is focused
|
||||||
|
menu_bar_->SetAcceleratorVisibility(true);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// When any other keys except single Alt have been pressed/released:
|
// When any other keys except single Alt have been pressed/released:
|
||||||
menu_bar_alt_pressed_ = false;
|
menu_bar_alt_pressed_ = false;
|
||||||
|
|
Loading…
Reference in a new issue