Skip to content

Commit

Permalink
fix startup delay on linux, (#4379)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Simon-Laux authored Dec 2, 2024
1 parent 464d0a7 commit ddc8a78
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 \<chat name\>" divider overflowing for long chat names #4375
- fix startup delay on linux #4379


<a id="1_48_0"></a>
Expand Down
17 changes: 10 additions & 7 deletions packages/target-electron/src/open_url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down

0 comments on commit ddc8a78

Please sign in to comment.