Skip to content

Commit

Permalink
#183 fix double click on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanebouget committed Jul 2, 2024
1 parent 4fbfd0c commit 4f38063
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions app/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,7 @@ app.on('will-finish-launching', function () {
if (win) {
setTimeout(() => {
win.webContents.send('file-open-system', fileToLoad);
}, 2500);
} else {
// if win is not ready, wait for it
app.once('browser-window-created', () => {
setTimeout(() => {
win.webContents.send('file-open-system', fileToLoad);
}, 2500);
});
}, 500);
}
}
});
Expand Down Expand Up @@ -107,6 +100,13 @@ function createWindow(): BrowserWindow {
win.loadURL(url.href);
}

// Traiter le fichier ouvert après que la fenêtre soit prête
if (fileToLoad) {
win.webContents.on('did-finish-load', () => {
win.webContents.send('open-file', fileToLoad);
});
}

// Emitted when the window is closed.
win.on('closed', () => {
// Dereference the window object, usually you would store window
Expand Down

0 comments on commit 4f38063

Please sign in to comment.