From e4f8945e89ee8ca0a10ec6ae7977c4460e80c48c Mon Sep 17 00:00:00 2001 From: Pragadesh-45 <54320162+Pragadesh-45@users.noreply.github.com> Date: Wed, 24 Sep 2025 01:53:41 +0530 Subject: [PATCH] fix: add Linux support for xdg-portal version in Electron app (#5618) --- packages/bruno-electron/src/index.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/bruno-electron/src/index.js b/packages/bruno-electron/src/index.js index 01f8a8494..267f3fb5e 100644 --- a/packages/bruno-electron/src/index.js +++ b/packages/bruno-electron/src/index.js @@ -1,6 +1,7 @@ const fs = require('fs'); const path = require('path'); const isDev = require('electron-is-dev'); +const os = require('os'); if (isDev) { if(!fs.existsSync(path.join(__dirname, '../../bruno-js/src/sandbox/bundle-browser-rollup.js'))) { @@ -21,6 +22,14 @@ if (isDev && process.env.ELECTRON_USER_DATA_PATH) { app.setPath('userData', process.env.ELECTRON_USER_DATA_PATH); } +// Command line switches +if (os.platform() === 'linux') { + // Use portal version 4 that supports current_folder option + // to address https://github.com/usebruno/bruno/issues/5471 + // Runtime sets the default version to 3, refs https://github.com/electron/electron/pull/44426 + app.commandLine.appendSwitch('xdg-portal-required-version', '4'); +} + const menuTemplate = require('./app/menu-template'); const { openCollection } = require('./app/collections'); const LastOpenedCollections = require('./store/last-opened-collections');