fix: don't construct submenu if it's invisible (#16834)
This commit is contained in:
parent
833daaa2b2
commit
062778c031
1 changed files with 2 additions and 1 deletions
|
@ -220,7 +220,8 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
|
|||
NSMenu* submenu = [[NSMenu alloc] initWithTitle:label];
|
||||
[item setSubmenu:submenu];
|
||||
[NSApp setServicesMenu:submenu];
|
||||
} else if (type == atom::AtomMenuModel::TYPE_SUBMENU) {
|
||||
} else if (type == atom::AtomMenuModel::TYPE_SUBMENU &&
|
||||
model->IsVisibleAt(index)) {
|
||||
// Recursively build a submenu from the sub-model at this index.
|
||||
[item setTarget:nil];
|
||||
[item setAction:nil];
|
||||
|
|
Loading…
Reference in a new issue