From ddc8a78480d76d63b1b1ba855e71e50e0a74bba8 Mon Sep 17 00:00:00 2001 From: Simon Laux Date: Mon, 2 Dec 2024 20:22:58 +0100 Subject: [PATCH] fix startup delay on linux, (#4379) * fix startup delay on linux, by disabling the functions to register DC as protocol handler - on linux this is anyway done by the desktop file fixes #4350 --- CHANGELOG.md | 1 + packages/target-electron/src/open_url.ts | 17 ++++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc54253eb2..2747103f43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ - the main window overflowing small screens, or/and if zoom level is high #4156 - do not clear the draft if sending failed. #4340 - "Search in \" divider overflowing for long chat names #4375 +- fix startup delay on linux #4379 diff --git a/packages/target-electron/src/open_url.ts b/packages/target-electron/src/open_url.ts index 69295a9990..5e7a274205 100644 --- a/packages/target-electron/src/open_url.ts +++ b/packages/target-electron/src/open_url.ts @@ -7,19 +7,22 @@ import { supportedURISchemes } from './application-constants.js' import { showDeltaChat } from './tray.js' import { ExtendedAppMainProcess } from './types.js' import { send, window } from './windows/main.js' +import { platform } from 'os' const log = getLogger('main/open_url') const app = rawApp as ExtendedAppMainProcess // Define custom protocol handler. Deep linking works on packaged versions of the application! // These calls are for mac and windows, on linux it uses the desktop file. -app.setAsDefaultProtocolClient('openpgp4fpr') -app.setAsDefaultProtocolClient('OPENPGP4FPR') -app.setAsDefaultProtocolClient('dcaccount') -app.setAsDefaultProtocolClient('DCACCOUNT') -app.setAsDefaultProtocolClient('dclogin') -app.setAsDefaultProtocolClient('DCLOGIN') -// do not forcefully set DC as standard email handler to not annoy users +if (platform() !== 'linux') { + app.setAsDefaultProtocolClient('openpgp4fpr') + app.setAsDefaultProtocolClient('OPENPGP4FPR') + app.setAsDefaultProtocolClient('dcaccount') + app.setAsDefaultProtocolClient('DCACCOUNT') + app.setAsDefaultProtocolClient('dclogin') + app.setAsDefaultProtocolClient('DCLOGIN') + // do not forcefully set DC as standard email handler to not annoy users +} let frontend_ready = false ipcMain.once('frontendReady', () => {