fix: Linux empty menu model handling (#15605)
* fix: Linux empty menu model handling * Update root_view.cc
This commit is contained in:
parent
ae9f4ef425
commit
48ebebcafe
2 changed files with 2 additions and 2 deletions
|
@ -894,7 +894,6 @@ void NativeWindowViews::SetMenu(AtomMenuModel* menu_model) {
|
|||
if (menu_model == nullptr) {
|
||||
global_menu_bar_.reset();
|
||||
root_view_->UnregisterAcceleratorsWithFocusManager();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!global_menu_bar_ && ShouldUseGlobalMenuBar())
|
||||
|
|
|
@ -178,9 +178,10 @@ bool RootView::AcceleratorPressed(const ui::Accelerator& accelerator) {
|
|||
}
|
||||
|
||||
void RootView::RegisterAcceleratorsWithFocusManager(AtomMenuModel* menu_model) {
|
||||
if (!menu_model)
|
||||
return;
|
||||
// Clear previous accelerators.
|
||||
UnregisterAcceleratorsWithFocusManager();
|
||||
|
||||
views::FocusManager* focus_manager = GetFocusManager();
|
||||
// Register accelerators with focus manager.
|
||||
accelerator_util::GenerateAcceleratorTable(&accelerator_table_, menu_model);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue