Skip to content

Commit

Permalink
[UX/Fix] Respect experimental UMU support disabled (#4191)
Browse files Browse the repository at this point in the history
* Respect experimental UMU config after new default change

* umuSupport experimental feature optional

* fix comparison of disableUMU check

* fix default `disableUMU` config for new games and old games
  • Loading branch information
arielj authored Mar 1, 2025
1 parent 506a114 commit 881ea95
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/backend/game_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@ class GameConfigV0 extends GameConfig {
// read game's settings
const settings = JSON.parse(readFileSync(this.path, 'utf-8'))
gameSettings = settings[this.appName] || ({} as GameSettings)
} else {
// only set the `disableUMU` default value when getting settings for a new game
// we want it to be `undefined` for games that were installed already
defaultSettings.disableUMU = false
}

if (!isWindows) {
Expand Down
17 changes: 16 additions & 1 deletion src/backend/utils/compatibility_layers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,22 @@ export async function isUmuSupported(
): Promise<boolean> {
if (!isLinux) return false
if (gameSettings.wineVersion.type !== 'proton') return false
if (gameSettings.disableUMU) return false
if (gameSettings.disableUMU === true) return false
if (gameSettings.disableUMU === undefined) {
// If the disableUMU setting is undefined it means the game was installed and configured
// before the introduction of this setting, so the usage of UMU was dictated by the
// experimental feature configuration.
//
// We have to check this to not enable UMU incorrectly even if the setting is not editable
// anymore.
// If we don't, we would end up enabling UMU for games that are already functional with proton
// without UMU to not mess their prefix
const experimentalFeatures =
GlobalConfig.get().getSettings().experimentalFeatures

// if UMU was never enabled or was enabled and then disabled
if (!experimentalFeatures?.umuSupport) return false
}
if (!checkUmuInstalled) return true
if (!existsSync(await getUmuPath())) return false

Expand Down
1 change: 1 addition & 0 deletions src/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export type ExperimentalFeatures = {
enableNewDesign: boolean
enableHelp: boolean
cometSupport: boolean
umuSupport?: boolean
}

export interface AppSettings extends GameSettings {
Expand Down

0 comments on commit 881ea95

Please sign in to comment.