From 37666b0f9f151774ac6cd38f869353a4ef77c27b Mon Sep 17 00:00:00 2001 From: SimonLaux Date: Mon, 2 Dec 2024 14:57:06 +0100 Subject: [PATCH] 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 af79cbf713..a3ad27033b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,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 diff --git a/packages/target-electron/src/open_url.ts b/packages/target-electron/src/open_url.ts index 69295a9990..f8f99b5dab 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', () => {