Conditionally set AutoHideMenuBar for Windows/Linux

This commit is contained in:
markatosi
2025-12-12 13:45:56 -10:00
committed by GitHub
parent 70e8f85123
commit 8d4cdddc46

View File

@@ -133,9 +133,10 @@ builder.UseElectron(args, async () =>
{
var options = new BrowserWindowOptions {
Show = false,
AutoHideMenuBar = true,
IsRunningBlazor = true, // <-- crucial
};
if (OperatingSystem.IsWindows() || OperatingSystem.IsLinux())
options.AutoHideMenuBar = true;
var browserWindow = await Electron.WindowManager.CreateWindowAsync(options);
browserWindow.OnReadyToShow += () => browserWindow.Show();
});