Force Linux file dialogs off XDG portal

This commit is contained in:
2026-04-14 13:21:51 +02:00
parent 0e4ff38b64
commit 9ac9970174
+6
View File
@@ -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();
}