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(); }