From 9ac99701740a01ef3140f6d3909e89b71a62b6d1 Mon Sep 17 00:00:00 2001 From: salman Date: Tue, 14 Apr 2026 13:21:51 +0200 Subject: [PATCH] Force Linux file dialogs off XDG portal --- main.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.js b/main.js index 7955f4e..5bc623c 100644 --- a/main.js +++ b/main.js @@ -4,6 +4,12 @@ const { app, BrowserWindow, Menu, dialog, ipcMain, fs } = require('electron'); // Fall back to software rendering instead of crashing on startup. app.disableHardwareAcceleration(); +if (process.platform === 'linux') { + // The XDG portal dialog backend ignores defaultPath on some systems and + // may cancel folder selection entirely in X11/SSH sessions. + app.commandLine.appendSwitch('xdg-portal-required-version', '999'); +} + function getDefaultDialogPath() { return process.cwd(); }