Skip to content

Commit 781747f

Browse files
Akos Kittakittaakos
Akos Kitta
authored andcommitted
Fixed the application name on macOS.
Patch for eclipse-theia/theia#8701. Signed-off-by: Akos Kitta <[email protected]>
1 parent 874c3ef commit 781747f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: arduino-ide-extension/src/electron-main/theia/electron-main-application.ts

+9
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,20 @@ import { app } from 'electron';
33
import { fork } from 'child_process';
44
import { AddressInfo } from 'net';
55
import { ElectronSecurityToken } from '@theia/core/lib/electron-common/electron-token';
6+
import { FrontendApplicationConfig } from '@theia/application-package/lib/application-props';
67
import { ElectronMainApplication as TheiaElectronMainApplication, TheiaBrowserWindowOptions } from '@theia/core/lib/electron-main/electron-main-application';
78

89
@injectable()
910
export class ElectronMainApplication extends TheiaElectronMainApplication {
1011

12+
async start(config: FrontendApplicationConfig): Promise<void> {
13+
// Explicitly set the app name to have better menu items on macOS. ("About", "Hide", and "Quit")
14+
// See: https://github.com/electron-userland/electron-builder/issues/2468
15+
// Regression in Theia: https://github.com/eclipse-theia/theia/issues/8701
16+
app.on('ready', () => app.setName(config.applicationName));
17+
return super.start(config);
18+
}
19+
1120
protected async getDefaultBrowserWindowOptions(): Promise<TheiaBrowserWindowOptions> {
1221
const options = await super.getDefaultBrowserWindowOptions();
1322
return {

0 commit comments

Comments
 (0)