From 59189051cedd9aac4b2e64ad2346c127dec3421a Mon Sep 17 00:00:00 2001 From: Steph Date: Fri, 2 Aug 2019 20:33:32 +0200 Subject: [PATCH] make dialogs modals make the file and message pop ups modals (children of the main window) so that they don't open up a second app instance/dock icon (at least in Linux, haven't test Windows or MacOS), and stay on top of the main window preventing getting lost confusingly behind main window. Disables main window when dialogues are open - can't think of a time when you wouldn't want this. --- public/electron.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/electron.js b/public/electron.js index d630886b..88ad8ec0 100644 --- a/public/electron.js +++ b/public/electron.js @@ -282,7 +282,7 @@ app.on('ready', async () => { // prompt when loading a space ipcMain.on(SHOW_LOAD_SPACE_PROMPT_CHANNEL, (event, options) => { - dialog.showOpenDialog(null, options, filePaths => { + dialog.showOpenDialog(mainWindow, options, filePaths => { mainWindow.webContents.send(RESPOND_LOAD_SPACE_PROMPT_CHANNEL, filePaths); }); }); @@ -293,7 +293,7 @@ app.on('ready', async () => { title: 'Save As', defaultPath: `${spaceTitle}.zip`, }; - dialog.showSaveDialog(null, options, filePath => { + dialog.showSaveDialog(mainWindow, options, filePath => { mainWindow.webContents.send( RESPOND_EXPORT_SPACE_PROMPT_CHANNEL, filePath @@ -310,7 +310,7 @@ app.on('ready', async () => { cancelId: 0, message: 'Are you sure you want to delete this space?', }; - dialog.showMessageBox(null, options, respond => { + dialog.showMessageBox(mainWindow, options, respond => { mainWindow.webContents.send(RESPOND_DELETE_SPACE_PROMPT_CHANNEL, respond); }); });