Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion packages/client/src/main/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { join, resolve } from 'node:path'
import { app, BrowserWindow, ipcMain, nativeImage, nativeTheme, shell, type NativeImage } from 'electron'
import { app, BrowserWindow, ipcMain, Menu, nativeImage, nativeTheme, shell, type NativeImage } from 'electron'
import { is } from '@electron-toolkit/utils'
import { registerAccountsIpc } from './accounts'
import { registerActionsIpc } from './actions'
Expand Down Expand Up @@ -58,6 +58,16 @@ function loadDevelopmentAppIcon(): NativeImage | undefined {
return icon.isEmpty() ? undefined : icon
}

// On Windows/Linux the Electron application menu renders as an in-window menu bar
// (File/Edit/View/Window). The app drives every command from its own UI and
// renderer keyboard shortcuts, so that native menu is redundant chrome — remove
// it. macOS keeps its menu bar: it lives in the system bar and provides the
// standard app/edit accelerators expected on that platform.
function configureApplicationMenu(): void {
if (process.platform === 'darwin') return
Menu.setApplicationMenu(null)
}

function createWindow(): void {
const icon = loadDevelopmentAppIcon()

Expand Down Expand Up @@ -124,6 +134,7 @@ function registerWindowIpc(): void {

void app.whenReady().then(() => {
app.setAppUserModelId('dev.oh-my-github.client')
configureApplicationMenu()
configureDevelopmentAppIcon()
registerAccountsIpc()
registerActionsIpc()
Expand Down
Loading