Skip to content

Commit

Permalink
fix: window closing + enable showWindowEarly
Browse files Browse the repository at this point in the history
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
  • Loading branch information
Akos Kitta committed Feb 9, 2024
1 parent 052b355 commit f32d5c0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ export class ElectronWindowService

@postConstruct()
protected override init(): void {
// NOOP
// Overridden to avoid calling the zoom level listener in super.
// IDE2 listens on the zoom level changes in `ArduinoFrontendContribution#onStart`

window.electronTheiaCore.onAboutToClose(() => {
this.connectionCloseService.markForClose(this.frontendIdProvider.getId());
});
}

async isFirstWindow(): Promise<boolean> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ export class ElectronMainApplication extends TheiaElectronMainApplication {
}
const [uri, electronWindow] = await Promise.all([
this.createWindowUri(),
this.createWindow(options),
this.reuseOrCreateWindow(options),
]);
electronWindow.loadURL(uri.withFragment(encodeURI(file)).toString(true));
return electronWindow;
Expand Down Expand Up @@ -885,7 +885,7 @@ const fallbackFrontendAppConfig: FrontendApplicationConfig = {
defaultIconTheme: 'none',
validatePreferencesSchema: false,
defaultLocale: '',
electron: {},
electron: { showWindowEarly: true },
reloadOnReconnect: true,
};

Expand Down
4 changes: 4 additions & 0 deletions electron-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@
},
"defaultIconTheme": "none",
"validatePreferencesSchema": false,
"electron": {
"showWindowEarly": true
},
"reloadOnReconnect": true,
"preferences": {
"window.title": "${rootName}${activeEditorShort}${appName}",
"files.autoSave": "afterDelay",
Expand Down

0 comments on commit f32d5c0

Please sign in to comment.