IDEA-298038: avoid complete clearing of appmenu

GitOrigin-RevId: 8b1e4110839b1e35b606af62dac211c5d782712a
This commit is contained in:
Artem Bochkarev
2022-08-02 17:17:23 +07:00
committed by intellij-monorepo-bot
parent 9f534bbebd
commit f39cc03d92
2 changed files with 4 additions and 6 deletions

Binary file not shown.

View File

@@ -265,12 +265,10 @@ Java_com_intellij_ui_mac_screenmenu_Menu_nativeRefill
}
} else {
// clear Main Menu: remove all except first (AppMenu)
id appMenu = [mainMenu numberOfItems] > 0 ? [mainMenu itemAtIndex:0] : nil;
if (appMenu != nil) {
[appMenu retain];
[mainMenu removeAllItems];
[mainMenu addItem:appMenu];
[appMenu release];
if ([mainMenu numberOfItems] > 0) {
for (int i = [mainMenu numberOfItems]; i - 1 > 0; i--) {
[mainMenu removeItemAtIndex:i - 1];
}
}
}