fix: set native menus per-window (#8444)

Previously when a new window was created `Menu.setApplicationMenu()` was
called, which would change all windows' native menu to the newly created
one - causing every window menu to reference the newly created
`BrowserWindow`.

Now each window is set their own `Menu` instance which will have their
own `BrowserWindow`.
This commit is contained in:
Steven Ward
2025-03-24 08:25:08 +00:00
committed by Jay Wu
parent a7802d4a07
commit 25795df347

View File

@@ -699,7 +699,7 @@ export function createWindow({ firstLaunch }: { firstLaunch?: boolean } = {}): E
template.push(developerMenu);
}
Menu.setApplicationMenu(Menu.buildFromTemplate(template));
mainBrowserWindow.setMenu(Menu.buildFromTemplate(template));
return mainBrowserWindow;
}