Force Linux file dialogs off XDG portal
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user