From ab25238f17bd52aa361db487a94435e97beb62c6 Mon Sep 17 00:00:00 2001 From: Aditya Toshniwal Date: Mon, 29 Jul 2024 10:18:39 +0530 Subject: [PATCH] Fix an issue where file dialog is not focussed on open in electron. --- runtime/src/js/pgadmin.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/src/js/pgadmin.js b/runtime/src/js/pgadmin.js index 4918e8fbf..2ffe091a7 100644 --- a/runtime/src/js/pgadmin.js +++ b/runtime/src/js/pgadmin.js @@ -337,9 +337,9 @@ function launchPgAdminWindow() { let splashWindow; // setup preload events. -ipcMain.handle('showOpenDialog', (_e, options) => dialog.showOpenDialog(options)); -ipcMain.handle('showSaveDialog', (_e, options) => dialog.showSaveDialog(options)); -ipcMain.handle('showMessageBox', (_e, options) => dialog.showMessageBox(options)); +ipcMain.handle('showOpenDialog', (e, options) => dialog.showOpenDialog(BrowserWindow.fromWebContents(e.sender), options)); +ipcMain.handle('showSaveDialog', (e, options) => dialog.showSaveDialog(BrowserWindow.fromWebContents(e.sender), options)); +ipcMain.handle('showMessageBox', (e, options) => dialog.showMessageBox(BrowserWindow.fromWebContents(e.sender), options)); ipcMain.handle('getStoreData', (_e, key) => key ? configStore.get(key) : configStore.store); ipcMain.handle('setStoreData', (_e, newValues) => { configStore.store = {