fix double drive_c issues

This commit is contained in:
olcxja 2026-10-03 08:43:19 +02:00
commit f2145d6678
7 changed files with 73 additions and 33 deletions

View file

@ -260,11 +260,14 @@ function registerIpc({ getWindow, onGamesChanged }) {
// shows up for wine as a regular C:\ install
ipcMain.handle('games:pickPrefixFolder', async (e, prefix) => {
// open the picker straight in the prefix's C: drive (plain wine: top
// level, Proton: under pfx/)
const driveC = prefixes.prefixDriveRoot(prefix)
// level, Proton: under pfx/); a prefix used with BOTH kinds has two of
// them, so it opens at the prefix folder - the only spot that keeps
// drive_c and pfx/drive_c one click away
const driveRoots = prefixes.prefixDriveRoots(prefix)
const start = driveRoots.length === 1 ? driveRoots[0] : prefixes.prefixPath(prefix)
const res = await dialog.showOpenDialog(getWindow(), {
title: i18n.translate(library.loadSettings().language, 'import.pickPrefixFolder'),
defaultPath: driveC || prefixes.prefixPath(prefix),
defaultPath: start,
properties: ['openDirectory']
})
return res.canceled || !res.filePaths[0] ? null : res.filePaths[0]