Skip to content

Commit

Permalink
fix startup delay on linux,
Browse files Browse the repository at this point in the history
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 committed Dec 2, 2024
1 parent 6c474ef commit 37666b0
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 @@ -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 \<chat name\>" divider overflowing for long chat names #4375
- fix startup delay on linux


<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'){

Check warning on line 17 in packages/target-electron/src/open_url.ts

View workflow job for this annotation

GitHub Actions / Code Validation

Insert `·`
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 37666b0

Please sign in to comment.